Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql case when exists in another table

SELECT A.name, 
       CASE WHEN B.name IS NOT NULL
       THEN 'common'
       ELSE 'not common'
       END

FROM table1 A
LEFT JOIN table2 B
ON A.name = B.name
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sql #case #exists #table
ADD COMMENT
Topic
Name
6+5 =