View Full Version : [help needed] MySQL Query to select Albums with rating

2009-03-12, 12:17
I try to get the tracks of a specific number of COMPLETE albums matching the following arguments...

On top of the list should be the tracks from the album that has the most voted number of files and of course the highest rating for the complete album (where rated NULL = 0).
Something like: order by numberofratedtracks, albumrating

I tryed this:
select t.album, t.id , t.url, a.title, ts.rating
from tracks t, albums a, track_statistics ts
where t.album = a.id
and t.url = ts.url
and t.audio = 1
order by t.album, ts.rating

What is mising:
-something to say how many complete albums I want
-rating is only sorted within albums

Can anybody help me!?