随机提取N条记录
发布时间:2016-12-28 来源:查字典编辑
摘要:随机提取10条记录的例子:Sqlserver:selecttop10*from表orderbynewid()Access:SELECTtop...
随机提取10条记录的例子:
Sqlserver:
selecttop10*from表orderbynewid()
Access:
SELECTtop10*FROM表ORDERBYRnd(id)
Rnd(id)其中的id是自动编号字段,可以利用其他任何数值来完成
比如用姓名字段(UserName)
SELECTtop10*FROM表ORDERBYRnd(len(UserName))
MySql:
Select*From表OrderByrand()Limit10