SQL Server:
复制代码代码如下:
SELECT TOP 10 * FROM T_USER ORDER BY NEWID()
ORACLE:
复制代码代码如下:
SELECT * FROM (SELECT * FROM T_USER ORDER BY DBMS_RANDOM.RANDOM()) WHERE ROWNUM <= 10
MySQL:
复制代码代码如下:
SELECT * FROM T_USER ORDER BY RAND() LIMIT 10
本文共 289 字,大约阅读时间需要 1 分钟。
SQL Server:
复制代码代码如下:
SELECT TOP 10 * FROM T_USER ORDER BY NEWID()
ORACLE:
复制代码代码如下:
SELECT * FROM (SELECT * FROM T_USER ORDER BY DBMS_RANDOM.RANDOM()) WHERE ROWNUM <= 10
MySQL:
复制代码代码如下:
SELECT * FROM T_USER ORDER BY RAND() LIMIT 10
转载于:https://www.cnblogs.com/youmingkuang/p/6514029.html