你的位置: Kiyo'Space首页 数据库 阅读文章 欢迎留下您的足迹

MYSQL随机抽取数据库里的几条数据

[ 数据库 ] 分享
mysql> use discuz;
Database changed

mysql> select username from cdb_members order by rand() limit 0,5;
+--------------+
| username     |
+--------------+
| hahamimi     |
| hyp323       |
| zjh00958     |
| 梦有知       |
| winteralways |
+--------------+
5 rows in set (0.03 sec)

mysql> select username from cdb_members order by rand() limit 0,5;
+-----------+
| username  |
+-----------+
| setnm2003 |
| Raymond   |
| nyyjy010  |
| 290500231 |
| samtian   |
+-----------+
5 rows in set (0.00 sec)

mysql> select username from cdb_members order by rand() limit 0,5;
+-------------+
| username    |
+-------------+
| ly2008      |
| tellgkkg    |
| 1502050124  |
| powershot   |
| adriftcloud |
+-------------+
5 rows in set (0.00 sec)

mysql> select username from cdb_members order by rand() limit 0,5;
+-----------+
| username  |
+-----------+
| Takeshi   |
| icelong   |
| 狗狗请罪  |
| 菜头      |
| weike1130 |
+-----------+
5 rows in set (0.01 sec)

mysql> select username from cdb_members order by rand() limit 0,5;
+----------+
| username |
+----------+
| 菜头     |
| romeoqq  |
| hahamimi |
| 青玫瑰   |
| lmhllr   |
+----------+
5 rows in set (0.00 sec)

mysql>


欢迎在此留下您的脚步






评论内容 (*必填):
(Ctrl + Enter 快速提交)