随机提取几条记录 推荐
发布时间:2023-09-19 09:55:48 所属栏目:Asp教程 来源:
导读:随机提取10条记录的例子:
Sql server:
select top 10 * from 表 order by newid()
Access:
Select top 10 * FROM 表 orDER BY Rnd(id)
Rnd(id) 其中的id是自动编号字段,可以利用其他任何数值
Sql server:
select top 10 * from 表 order by newid()
Access:
Select top 10 * FROM 表 orDER BY Rnd(id)
Rnd(id) 其中的id是自动编号字段,可以利用其他任何数值
随机提取10条记录的例子: Sql server: select top 10 * from 表 order by newid() Access: Select top 10 * FROM 表 orDER BY Rnd(id) Rnd(id) 其中的id是自动编号字段,可以利用其他任何数值来完成 比如用姓名字段(UserName) Select top 10 * FROM 表 orDER BY Rnd(len(UserName)) MySql: Select * From 表 order By rand() Limit 10 (编辑:汽车网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐