首页 > 数据库技术 > 详细

PHP-- 三种数据库随机查询语句写法

时间:2016-09-13 20:45:47      阅读:173      评论:0      收藏:0      [点我收藏+]

1. Oracle,随机查询查询语句-20条

select * from


 select  *  from 表名
 order by dbms_random.value

)
 where rownum <= 20;

2.MS SQL Server,随机查询语句-20条

select top 20  * from  表名order by newid()

3.My SQL:,随机查询语句-20条

select  *  from  表名 order by rand() limit 20

PHP-- 三种数据库随机查询语句写法

原文:http://www.cnblogs.com/mafeng/p/5869607.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!