Hi, I have a table with 2 columns:
ID, ID_PROJ_CSR
the content of that table is:
ID ID_PROJ_CSR
747 222
785 102
786 222
787 223
788 224
I want to select the ID, but if any value from ID_PROJ_CSR is a duplicate, I need to select any ID of the rows that contains that duplicate value (in that example, select ID 747 OR 786
I try:
select * from my_table tab
where tab.id_proj_csr =(select top 1 id_proj_csr
from my_table mt
where mt.id_proj_csr = tab.id_proj_csr)