【转载】SQL 随机读取数据表中N条不重复记录

mysql中随机提取数据库记录
select * from tablename order by rand() limit 10

-------------------------------------------------------------------------------

sqlserver中随机提取数据库记录
select top 10 * from tablename order by NEWID()

--------------------------------------------------------------------------------

Access中随机提取数据库记录
SELECT top 10 * FROM tblTable ORDER BY Rnd(FId)

--------------------------------------------------------------------------------

posted @ 2012-02-13 14:26  witrays  阅读(374)  评论(0编辑  收藏  举报