Forum Moderators: open

Message Too Old, No Replies

Two random results

         

orion_rus

4:00 pm on Apr 30, 2006 (gmt 0)

10+ Year Member



Hello world i have a database with wonders and want to show each loading page 2 random wonders from it.
Is it possible to make randoming in a sql level?
Thanks in advance

emsaw

2:12 pm on May 1, 2006 (gmt 0)

10+ Year Member



orion_rus,

{found on goog}

look into newId() :

SELECT top 2 *
FROM mytable
ORDER BY newid()

HTH,

Mark

Nutter

7:55 pm on May 1, 2006 (gmt 0)

10+ Year Member



SELECT field FROM table ORDER BY RAND() LIMIT 2