-- These are demo tables
with pending(process_id)
as
(select 1 from dual union all
select 2 from dual union all
select 3 from dual union all
select 4 from dual union all
select 5 from dual),
salary(emp_id, salary)
as
(select 101, 100 from dual union all
select 202, 200 from dual union all
select 303, 300 from dual union all
select 404,400 from dual union all
select 505, 500 from dual)
NVL2( string1, value_if_not_null, value_if_null )
NVL2(select count(*) from pending, "pending processing, stop query processing further" , select * from salary )
We are looking for logic like below, It might /might not be done in SQL itself. But, looking for some ideas
Select count(*)from pending is not null
then Stop Further query processing
else
select * from salary -- continuing next set of SQL statements