I have a table directors
and need to get all duplicated rows
Checking columns is name
and phone_number
Table directors
uuid | name | phone_number |
---|---|---|
5esd | ari | 111-222-333 |
6dcv | lee | 111-222-333 |
56js | poo | 667-784-343 |
tug8 | ari | 866-653-343 |
I need these rows:
uuid | name | phone_number |
---|---|---|
5esd | ari | 111-222-333 |
6dcv | lee | 111-222-333 |
tug8 | ari | 866-653-343 |
ecause two upper rows has same phone number and last record has same name as first row
What I tried is
select d1.* from directors as d1
join (
select d2.* from directors d2
group by `d2`.`uuid`
having count(d2.phone_number) > 1
or count(d2.name) > 1
) d2 on d1.uuid = d2.uuid;
2
Answers
Just one of possible options:
https://sqlize.online/sql/psql14/f7d63b0d5d06a4d6d428798da644dcbb/
One more example:
https://sqlize.online/s/MW
A couple of options you can use: