#897
[DB] Select random row
Oracle :
SELECT column FROM ( SELECT column FROM table ORDER BY dbms_random.value ) WHERE rownum = 1
MySQL :
SELECT column FROM table ORDER BY RAND() LIMIT 1
Just another Code Snippet site
#897
Oracle :
SELECT column FROM ( SELECT column FROM table ORDER BY dbms_random.value ) WHERE rownum = 1
MySQL :
SELECT column FROM table ORDER BY RAND() LIMIT 1
Comments are currently closed.