Here's a couple of alternatives that might be worth trying. No promises, mind. The second one would benefit from a composite (col1,col2) index, I would think
Code:Select Distinct a.col1, a.col2 From table1 a, table1 b, Where a.col1 = b.col1 And a.col2!= b.col2 /Code:Select col1, col2 From ( Select col1, col2, Count(Distinct col1) Over (Partition By col1) cd_col2 From table1 Where col1 is not null ) Where cd_col2 > 1




Reply With Quote