Forums

This topic is locked

ORDER BY RND RETURNS SAME RECORD

Posted 13 Mar 2003 14:31:00
1
has voted
13 Mar 2003 14:31:00 Simon Winter posted:
Hi, I am developing a site using DMX and Access for which i need to return a random record in a related products section. I am currently using the following sql statement

SELECT ProductName, ProductID, ProductThumbnail
FROM Products
WHERE ProductSection = 'BannerStands'
ORDER BY RND(ProductID)

Although this does seem to return the records in a random order it is the same 'random' order each time. As I am displaying the first record returned I get the same result in my page each time. I've trauled the net but can't seem to find a simple solution to this that does not involve rewriting the ASP code. If anyone can help me I would very gratefull

Replies

Replied 10 Apr 2003 06:44:41
10 Apr 2003 06:44:41 Burak Tutan replied:
Try this one.
...
ORDER BY RAND()

Reply to this topic