Is the query below correct to find columns for which the HashCode is the same but PageUrl different rows? This would mean basically collisions in my database planning.
select T1.PageUrl,T1.HashCode from tblPages as T1 inner join
(select PageUrl,HashCode from tblPages group by PageUrl,HashCode) as T2 on
T1.PageUrl!=T2.PageUrl and T1.HashCode=T2.HashCode
I am using 64 bit HashCode.
MS-SQL 2008 R2
I’d use a
CROSS JOINwith aWHEREclause rather than yourINNER JOIN.The reason for this is that the optimizer will give you a better query plan with the cross join. Link to an example.