各个数据库获取随机列的语法_MySQL
程序员文章站
2022-05-30 12:05:43
...
bitsCN.com
各个数据库获取随机列的语法
[html]
各个数据库获取随机列的语法
MySQL
SELECT column FROM table ORDER BY RAND() LIMIT 10
Oracle
SELECT column FROM( SELECT column FROM table ORDER BY dbms_random.value ) WHERE rownum
PostgreSQL
SELECT column FROM table ORDER BY RANDOM() LIMIT 10
SQL Server
SELECT TOP 10 column FROM table ORDER BY NEWID()
bitsCN.com