Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Sql :: how to find lowest salary by departments ? 
Sql :: 10 random questions use python and SQL 
Sql :: the primary key is selected from the 
Sql :: kie business put user infos in database 
Sql :: mysql order by where condition sub query 
Sql :: SQL Manipulação de Tabelas Constraint 
Sql :: dbt unique key 
Sql :: tsql rename column name 
Sql :: how to install sql server 
Sql :: subquery 
Sql :: oracle foreign key reference table 
Sql :: selecting names ending with vowels in sql 
Sql :: Get the User Name and Domain Name from an Email Address 
Sql :: docker mysql connection refused 
Sql :: like and not like together in sql 
Sql :: check if two tables are identical sql 
Sql :: mysql insert into select transaction c# 
Csharp :: c# messagebox yes no 
Csharp :: hello world program in c# 
Csharp :: unity how to see what scen you are in 
Csharp :: check dotnet version command line 
Csharp :: csgo throw last grenade bind 
Csharp :: c# if file exists 
Csharp :: how to clear console in c# 
Csharp :: c# linq extension methods left join 
Csharp :: c# for loop backwards 
Csharp :: c# put string to clipboard 
Csharp :: exit application wpf 
Csharp :: c# remove last value from list 
Csharp :: unity spawn object at position 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =