select s1.id, s1.title, s1.username, sum(plv.view_count) sumc from (SELECT pl.id, pl.title, u.username from playlist pl, user u where pl.author_id=u.id and pl.deleted=false and pl.submitted=true and pl.bg_audio_id=10030 ) s1 LEFT JOIN playlistviews plv ON s1.id=plv.playlist_id group by s1.id order by sumc desc LIMIT 0, 20
|