Reputation: 39
I have a table in MySql like :
URL Browser
A Chrome
B Chrome
C Firefox
A Chrome
A Firefox
A Opera
A Chrome
B Chrome
B Firefox
C Tor
The URL
column has a wide range of data, but the Browser column has a limited set. I want to aggregate on the URL column and get the top counts for each browser in a list in descending order, like :
URL FrequentlyUsedBrowser
A [(Chrome,3),(Firefox,1),(Opera,1)]
B [(Chrome,2),(Firefox,1)]
C [(Chrome,1),(Tor,1)]
I have been writing SQL
for it to use window partition to get the count as one entry for each browser, but not been able to get it into a list.
Upvotes: 0
Views: 937