mysql,access,sql 随机读取N条记录的写法

随机取出n条记录:
Sql server:select top n * from 表 order by newid()
Access:Select top n * FROM 表 orDER BY Rnd(id)
mysql:Select * From 表 order By rand() Limit n

收藏本文到网摘: 百度搜藏 QQ书签 Google书签 Del.icio.us 新浪ViVi 雅虎收藏 饭否 365Key网摘 天极网摘 POCO网摘 和讯网摘

Random Posts

Leave a Reply