SELECT `users_guests`.`id_user` ,
COUNT( id_user ) AS guests
FROM `users_guests`
GROUP BY `users_guests``.id_user`
ORDER BY guests DESC
LIMIT 10;
JOIN
SELECT COUNT(users_guests.id_user ) AS любое название
FROM `users `, 'users_guests'
WHERE 'users.gender' = "Мужской" AND 'users.active' = "Y"
AND 'users.id' = 'users_guests.id