I have a users table that has duplicate values ββin the employee_id column. I need to list all rows with duplicate employee_ids along with their names. I need to see all users with a duplicate employee_id so that I can deconflict which values ββare valid.
SELECT name,employee_id FROM users; name | employee_id
I need to return:
name | employee_id ------------------------- jason 12345 jane 12345 bill 12345
I see similar questions, but I still canβt get the correct syntax that I need. From below, I only get one event. I need all events with a duplicate employee_id as above.
SELECT employee_id, MAX(name) FROM users GROUP BY employee_id HAVING COUNT(employee_id) > 1;
source share