SELECT DISTINCT ut.user_name, ut.userid, pc.project_id FROM proj_contractor AS pc, users_table AS ut WHERE ut.userid = pc.userid ##sql_restrict##