如何获取RANDOM User_names。
SELECT a.mod_name, u.user_name, a.id from type a, users u
WHERE a.id=u.mod_type
ORDER BY mod_type Desc ";
答案 0 :(得分:4)
您可以使用ORDER BY RAND()
:
SELECT a.mod_name, u.user_name, a.id
FROM type a, users u
WHERE a.id=u.mod_type
ORDER BY RAND()
答案 1 :(得分:3)
怎么样?
编辑:
select a.mod_name, u.user_name, a.id from type a, users u where a.id=u.mod_type
order by mod_type DESC, rand();
答案 2 :(得分:2)
Mysql支持RAND()
功能
select a.mod_name, u.user_name, a.id from type a,
users u where a.id=u.mod_type
order by RAND(),mod_type Desc ";