Tara-1044200 (6/11/2013)
I want to do this.select count(*) from
(
select col1,col2,......col18 from REVemployee.tbemp
group by col1,col2,......col18 HAVING COUNT(*)>1
)a
is there a better way of doing the same for better proformance?
Looks fine to me. But you also can try this:
select count(*) from
(
select null a from REVemployee.tbemp
group by col1,col2,......col18 HAVING COUNT(*)>1
)a
You might have slightly better performance.
You can also find duplicates using windowed function, but this very likely to be much slower.