您的位置:首页 > 编程语言 > PHP开发

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

2016-09-13 20:00 239 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: