從數據庫表格中隨機抽取行有什麼用?因為有時候你會想要給用戶展示一些隨機的信息
MySQL中提取
SELECT column FROM table
ORDER BY RAND()
LIMIT
Oracle中提取
SELECT column FROM
( SELECT column FROM table
ORDER BY dbms_randomvalue )
WHERE rownum <=
PostgreSQL中提取
SELECT column FROM table
ORDER BY RANDOM()
LIMIT
Microsoft SQL Server中提取
SELECT TOP
column FROM table
ORDER BY NEWID()
From:http://tw.wingwit.com/Article/program/SQL/201311/16405.html