Reputation: 4370
How to fetch 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 ";
Upvotes: 4
Views: 91
Reputation: 4478
What about
EDIT:
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();
?
Upvotes: 3
Reputation: 9457
Mysql supports RAND()
function
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 ";
Upvotes: 2
Reputation: 21979
You can use ORDER BY RAND()
for that:
SELECT a.mod_name, u.user_name, a.id
FROM type a, users u
WHERE a.id=u.mod_type
ORDER BY RAND()
Upvotes: 4