SELECT DISTINCTROW `u` . `id` , `u` . `username` , `u` . `realname` FROM `mantis_user_table` `u` LEFT JOIN `mantis_project_user_list_table` `p` ON `p` . `user_id` = `u` . `id` AND `p` . `project_id` = ? WHERE `u` . `access_level` < ? AND `u` . `enabled` = ? AND `p` . `user_id` IS NULL ORDER BY `u` . `realname` , `u` . `username` 