SELECT DISTINCTROW `p` . `id` , `p` . `name` FROM `mantis_project_table` `p` LEFT JOIN `mantis_project_user_list_table` `u` ON `p` . `id` = `u` . `project_id` AND `u` . `user_id` = ? WHERE `p` . `enabled` = ? AND `u` . `user_id` IS NULL ORDER BY `p` . `name` 