Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql where length greater than 
Sql :: mysql time 
Sql :: sql run multiple updates in one query 
Sql :: sql use not in 
Sql :: oracle sql for each row 
Sql :: multiple count with where clause sql 
Sql :: oracle show parameter 
Sql :: ORA-01090: shutdown in progress - connection is not permitted 
Sql :: import mysql dump database command line linux 
Sql :: postgressum when 
Sql :: sql restore backup query 
Sql :: insert into table from another table 
Sql :: identify primary key in oracle table 
Sql :: osm2pgsql mac 
Sql :: sql select all records from all tables where not empty 
Sql :: how to connect to postgres 
Sql :: smallint sql 
Sql :: how to casting data types in postgresql 
Sql :: mysql sql select one day before 
Sql :: influxdb delete measurement based on date 
Sql :: how to find total working hour in sql 
Sql :: sql distinct clause 
Sql :: top 3 salary in sql 
Sql :: r write csv without index 
Sql :: oracle undo tablespace list by user 
Sql :: add column postgresql 
Sql :: remove all spaces from string sql 
Sql :: C# mysql data reader from two tables 
Sql :: select only unique values from and to current table 
Sql :: sql create cluster index 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =