I cannot find the answer to the abovementioned problem in the title.
I need to select all rows that have the identical ID and all other column values must also be identical as well. This table consists of 20 columns.
Any suggestion would be much appreciated! Many thanks.
CodePudding user response:
How about this
select id, name, ...other fields
from my_table
where id in (
Select id, count(id)
from my_table
group by id, name, ...other fields
having count(id) > 1
)
Change group by and where conditions accordingly