SQL Server query with same functionality as Excel VLookup -


i have 2 columns of data need compare each other - column , column b.

column a:

steve jane mary peter ed scott ted 

column b:

peter scott david nancy 
  • column has larger amount of data column b.
  • but may not have values in column b.

i need find out of values in column b in column a.

output expected above sample data:

peter   true scott   true david   false nancy   false 
  • need use sql server / t-sql output.
  • column , column b fields in 2 separate tables
  • there no other columns in 2 tables

thanks help!

select     b.columnb,    case when a.columna null 'false' else 'true' end      tableb b left outer join    tablea on b.columnb = a.columna 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -