Jul 28, 2004 #1 jliang MIS Apr 26, 2004 30 US Hi, I need write a sql like: select case when a.col1 in (select col1 from table2) then 'ok' else 'fail' end from table2 b Can I pass a derived table in this statement? Many thanks in advance Jing
Hi, I need write a sql like: select case when a.col1 in (select col1 from table2) then 'ok' else 'fail' end from table2 b Can I pass a derived table in this statement? Many thanks in advance Jing
Jul 28, 2004 #2 ChandruN Programmer Jun 17, 2003 13 US try this select case when a.col1 = b.col1 then 'ok' else 'fail' end from ( table1 a left outer join table2 b on a.col1 = b.col1 ) Upvote 0 Downvote
try this select case when a.col1 = b.col1 then 'ok' else 'fail' end from ( table1 a left outer join table2 b on a.col1 = b.col1 )