I have the following data -
Code1 Code2
G01621 E04621
I want to show all codes that are in code1 but not in code2.
I wrote the following SQL, but it is returning incorrect data -
select * from codes c1
left join codes c2
on lower(c1.code1) = lower(c2.code2)
where c2.code2 is null