Suppose that have 2 columns: folders and tags:
Code:
~/Music|classic,rock
~/Music|classic,rock
~/Pictures|art,photos
~/Pictures|art,photos
~/Pictures|art,photos
To know the folder count I do:
Code:
sqlite3 test.db "select folder, count(folders) from t1 group by folder"
Returns:
Code:
~/Music|2
~/Pictures|3
How can I do the same for tags using only sqlite to get this:
Code:
art|3
classic|2
photos|3
rock|2
Another question, is there any way to get max count for all grouped columns in one single consult?
It should return something like this:
Meaning that the first column has 2 unique values (~/Music and ~/Pictures) and the second column has 4 (art, classic. photos and rock)
Many thanks in advance!
Bookmarks