怎么从数据库中随机读取数据

axiu70 2007-07-25 11:41:39
怎么从数据库中随机读取数据
如 从表table1随机读取10数据要怎么写

...全文
200 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
axiu70 2007-07-25
  • 打赏
  • 举报
回复
sql:
select top 10 * from table1 order by newid()

access:

select top 10 * from table1 order by rnd()
derrial 2007-07-25
  • 打赏
  • 举报
回复
newid()
fa_ge 2007-07-25
  • 打赏
  • 举报
回复
select top 10 * from table1 order by newid()
paoluo 2007-07-25
  • 打赏
  • 举报
回复
...

10秒
paoluo 2007-07-25
  • 打赏
  • 举报
回复
Select TOP 10 * From table1 Order By NewID()
gahade 2007-07-25
  • 打赏
  • 举报
回复
select top 10 * from table1 order by newid()

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧