如何获取随机用户名。
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 ";
您可以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()
关于什么
编辑:
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();
?
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 ";