How to use IF-THEN-ELSE statement for a sub-query of my main select statement
Hi Gurus
I have an interesting problem that I am battling to resolve. I have written a sql query that spans multiple sub-queries in the from section of the main query. i.e.
Select ax.a,
by.b
from table z
(select 1 a,
2 b
from table x) ax,
(select 2 b
2 c
from table y) by
where ax.b = z.b
and by.c = z.b
and z.assignment_id = 180
Now if each sub-query returns rows the query will return data, however let us say the first sub has not data for assignment 180 but the second sub-query does have data for assignment 180 then the complete query will return no rows.