title: if subquery returns no rows fetch all the records or ignore that condition
body: <pre><code>SELECT DISTINCT VISION_SBU, SBU_DESCRIPTION
    FROM (SELECT 'All' VISION_SBU, 'All' SBU_DESCRIPTION, 1 sort_order FROM DUAL
          UNION ALL
          SELECT ALPHA_SUB_TAB, ALPHA_SUBTAB_DESCRIPTION, case when ALPHA_SUB_TAB = 'NA' then 99999 else row_number() over (order by ALPHA_SUB_TAB) +1 end sort_order
            FROM ALPHA_SUB_TAB
           WHERE ALPHA_TAB = 3) H1
  where VISION_SBU in (
  select t2.sbu from vision_user t1 left outer join VU_RESTRICT_SBU t2
  on t1.vision_id = t2.vision_id
  where t1.vision_id = #VISION_ID#)
  and  account_officers in  (
  select t2.account_officer from vision_user t1 left outer join VU_RESTRICT_SBU t2
  on t1.vision_id = t2.vision_id
  where t1.vision_id = #VISION_ID#)
  and  vision_ouc in  (
  select t2.vision_ouc from vision_user t1 left outer join VU_RESTRICT_SBU t2
  on t1.vision_id = t2.vision_id
  where t1.vision_id = #VISION_ID#)
  </code></pre>
  <p>when the where clause sub query matches the filter data only that data should be displayed,
  when the where clause sub query returns no rows then that filter should not be applied for the where clause.</p>
  <p>Also we have multiple queries so request you to a logic with the optimized solution.</p>