Hello, I'm trying to use the folllowing to order my select statement randomly, but get the following error:
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near 'LIMIT'.
I've seen a bunch of examples and can't seem to get any of them tho work.
What is the best way to have my select statement return the rows in a random order?
SELECT
a.[slideid],
a.[albumid],
a.[title],
a.[description],
a.[image],
a.[thumbnail]
FROM LandT_Slide a, LandT_Album b
WHERE b.albumtype = @albumtype
and a.albumid = b.albumid
ORDER BY RAND() LIMIT 1
Start Free Trial