table t1-- id name 1 a 2 b 3 c 4 d 5 e table t2 -- id name 2 c 3 r 5 z i want output using a single line query as : id name 1 a 2 c 3 r 4 d 5 z
select t1.id,case when t2.name is null then t1.name else t2.name end as name from t1 left join t2 on t1.id=t2.id
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)