I have 2 columns of data that I need to compare with each other - Column A and Column B.
Column A:
Steve
Jane
Mary
Peter
Ed
Scott
Ted
Column B:
Peter
Scott
David
Nancy
I need to find out which of the values in column B are also in column A.
Output expected for above sample data:
Peter TRUE
Scott TRUE
David FALSE
Nancy FALSE
Thanks for all your help!
select
b.columnb,
case when a.columna is null then 'FALSE' else 'TRUE' end
from
tableb b left outer join
tablea a on b.columnb = a.columna
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With