mysql中随机提取数据库记录

来源:互联网 发布:ubuntu怎么编译c语言 编辑:程序博客网 时间:2024/04/29 09:22

mysql中随机提取数据库记录

  -------------------------------------------------------------------------------- view plaincopy to clipboardprint?

  select * from tablename order by rand() limit 10

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

  -------------------------------------------------------------------------------- view plaincopy to clipboardprint?

  select top 10 * from tablename order by NEWID()

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

  -------------------------------------------------------------------------------- view plaincopy to clipboardprint?

  SELECT top 10 * FROM tablename ORDER BY Rnd(FId)

  SELECT top 10 * FROM tablename ORDER BY Rnd(FId)FId:为你当前表的ID字段名

原创粉丝点击