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
Post a Comment