DrNic wrote:
>
> Does any of that make sense to you?!!
>
Try to change it to this:
Code:
--------------------
-- PlaylistName:Random songs Limited Rating (no Xmas)
-- PlaylistGroups:
create temporary table randomweightedratingslow as select tracks.url from
tracks
left join dynamicplaylist_history on
tracks.id=dynamicplaylist_history.id
left join track_statistics on
tracks.url=track_statistics.url
where
audio=1
and ifnull(track_statistics.rating,0)<80
and dynamicplaylist_history.id is null
and not exists (select * from tracks t2,genre_track,genres
where
t2.id=tracks.id and
tracks.id=genre_track.track and
genre_track.genre=genres.id and
genres.name in ('Childrens Music','Holiday','Books & Spoken'))
order by random()
limit 30;
create temporary table randomweightedratingshigh as select tracks.url from
tracks
left join dynamicplaylist_history on
tracks.id=dynamicplaylist_history.id
left join track_statistics on
tracks.url=track_statistics.url
where
audio=1
and track_statistics.rating>=80
and dynamicplaylist_history.id is null
and not exists (select * from tracks t2,genre_track,genres
where
t2.id=tracks.id and
tracks.id=genre_track.track and
genre_track.genre=genres.id and
genres.name in ('Childrens Music','Holiday','Books & Spoken'))
order by random()
limit 70;
create temporary table randomweightedratingscombined as
SELECT * FROM randomweightedratingslow
UNION
SELECT * from randomweightedratingshigh;
SELECT * from randomweightedratingscombined
ORDER BY random()
limit 10;
DROP TABLE randomweightedratingshigh;
DROP TABLE randomweightedratingslow;
DROP TABLE randomweightedratingscombined;
--------------------
Basically SQLite needs the " as " before the " select" keyword and
"rand()" needs to be "random()".
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=96614
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins