I'm having problems with SS 6.5 using the a SQL Playlist that I used
successfully with 6.3.x.
The following query used to return all tracks from a single album that
had tracks tagged with the 'Mix' genre. It now usually doesn't return
anything, but occasionally returns just one track. I've played about
with the query using SQLyog (which is pretty useful) but can't see what
the problem is. The nested query works fine (it returns 95 rows when not
limited by 'limit 1') and the main query works fine given an album ID,
so where's the problem?
Code:
--------------------
select tracks.url
from tracks, albums
where tracks.album = albums.id
and albums.id =
(select distinct albums.id
from tracks, albums, genre_track, genres
where genres.name = 'Mix'
and genre_track.genre=genres.id
and tracks.id = genre_track.track
and tracks.album = albums.id
and albums.titlesort not in ('NO TITLE','N/A','UNKNOWN ALBUM','NO ALBUM')
order by rand() limit 1)
order by tracks.disc, tracks.tracknum
--------------------
Can anyone see anything obviously wrong with this query or suggest an
alternative way of doing it?
--
dSw
------------------------------------------------------------------------
dSw's Profile: http://forums.slimdevices.com/member.php?userid=362
View this thread: http://forums.slimdevices.com/showthread.php?t=20533
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins