现在的位置: 首页 > 综合 > 正文

MySQL随机抽取一条数据

2013年01月21日 ⁄ 综合 ⁄ 共 128字 ⁄ 字号 评论关闭

MYSQL:

show databases;

use test;

show tables;

随机抽取两条数据:

select * from  emp order by rand() limit 2;

随机抽取某一作用域:

select id from emp order by rand() limit 1;

【上篇】
【下篇】

抱歉!评论已关闭.