You shouldn't need DISTINCT for users.name, there are no duplicate users in the users table.