Hi, Am 07.07.17 um 12:16 schrieb Patrick B:
one possibility is: select distinct case when regdate = 1 THEN 'yes' when regdate = 2 THEN 'no' end as status_a , t2.id is null as test2exists from test1 t1 left join test2 t2 on t2.test1_id = t1.id hth Thomas |