Yes, I was actually having that broad view on this, and got a bit
frustrated when I couldn't get it right.

Now I done some more work and currently at a point where I got a query
that does random songs (any) from my 20 most played artists.


select url from tracks, contributor_track
where contributor in (
select contributor from (
        select c1.contributor, sum(ifnull(ts1.playCount,0)) as sumcount 
                from tracks t1, track_statistics ts1, contributor_track c1
                where t1.url = ts1.url
                and t1.id = c1.track
                and c1.role in (6)
                and t1.audio=1
                group by c1.contributor
                order by sumcount desc
        limit 20
        ) 
) and tracks.id = contributor_track.track and contributor_track.role =
6
order by random()
limit 10

I am not a SQL expert so it may very well have room for improvement and
optmization.


-- 
mykee
------------------------------------------------------------------------
mykee's Profile: http://forums.slimdevices.com/member.php?userid=39555
View this thread: http://forums.slimdevices.com/showthread.php?t=91625

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to