随机获取10条数据的方法
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