I need to select duplicate values highlighted in green from the Object table show below:
I've tried different combination of the code below. But cannot return the two duplicate rows.
;with CTE as
(Select distinct ID, count([Object ID]) as [Object ID]
from #Object
group by ID having count([Object ID]) > 1)
select * from CTE where
NOT EXISTS (Select distinct ID , count(distinct [Object ID]) as [Object ID]
from #Object group by ID having count(distinct [Object ID]) > 1);