Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

select true if exists on another table or false sqlserver

  select A.name, 
       CASE WHEN B.name IS NOT NULL
       THEN 1
       ELSE 0
       END

    from table1 A
    left join table2 B
    on A.name = B.name
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #select #true #exists #table #false #sqlserver
ADD COMMENT
Topic
Name
4+1 =