You can find out the dupes/ cross join that is causing the issue with the sql below:
select a.COL1,a.COL2, count(*)
FROM
a,
tmp
WHERE a.COL1 = tmp.COL1 and
a.COL2 = tmp.COL2 and
a.flag <> 'N'
group by 1,2
having count(*) > 1;
↧