SELECT `ul`.`user_id`, `ul`.`name`, `ul`.`uid`, `ul`.`gender`
FROM `users_list` AS `ul`
JOIN `users_groups` AS `ug` ON `ul`.`user_id` = `ug`.`user_id`
JOIN `groups_list` AS `gl` ON `gl`.`group_id` = `ug`.`user_id`
WHERE `gl`.`uid` = :gid;