SQLIte group by issue -


i have problem sqlite query designed return information each album record artists in database table called tracks. query works fine if album names unique if have album name duplicated, example many artists have albums called 'greatest hits', find same album artwork every artist 'greatest hits' album name.

here sql query:

select distinct artistname, trackname, trackpath, imagepath, year, albumname, bpm, genre1, genre2, genre3  tracks genre1='pop' or genre2='pop' or genre3='pop'  group albumname  order artistname 

change

 group albumname  

to

 group artistname, albumname  

the original group by clause tells system "roll up" data there's 1 line per albumname. want 1 line per unique albumname / artistname combination.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -