hazelsisson
Programmer
Hello,
I have a query which is similar to this:
The problem is when one of the sub-selects returns 0 rows the whole query doesn't work - I think the result is null.
Is there are any way to get round this? E.g. using nvl/decode, or structuring the query differently? I've tried a few things and they haven't worked so far.
Thanks,
Hazel
I have a query which is similar to this:
Code:
select SUM(ENTITLEMENT)
into timeAllocated
from bh_entitlements
where edate between l_start and l_end
and staff_id = l_user
and edate not in
(
select tdate
from bh_time t
where (conditions)
)
and edate not in
(
select tdate
from lieu_time l
where (conditions)
)
and edate not in
(
select ldate
from leave_requests r
where (conditions)
);
The problem is when one of the sub-selects returns 0 rows the whole query doesn't work - I think the result is null.
Is there are any way to get round this? E.g. using nvl/decode, or structuring the query differently? I've tried a few things and they haven't worked so far.
Thanks,
Hazel