SELECT DISTINCTROW ( `up` . `id` ) , `up` . `user_id` , `up` . `platform` , `up` . `os` , `up` . `os_build` FROM `mantis_user_profile_table` `up` JOIN `mantis_bug_table` `b` ON `b` . `profile_id` = `up` . `id` WHERE `project_id` = ? ORDER BY `up` . `platform` , `up` . `os` , `up` . `os_build` 