title: PLSQL Select first value if exists, otherwise select another value
body: <p>I have a table like this</p>
  
  <pre><code>ID NTYPE
  1 0
  2 0
  3 1
  4 2
  </code></pre>
  
  <p>I need a select to get all IDs according of a list of NTYPE (1 to N), but if any of the NTYPE list does not exist then get where NTYPE = 0..</p>
  
  <p>For example:</p>
  
  <ul>
  <li>If NTYPE list = 1 then The IDs must be 3</li>
  <li>If NTYPE list = 1,2 then The IDs must be 3,4</li>
  <li>If NTYPE list = 2,3 then The IDs must be 1,2,4... 1 and 2 because there is not records where ntype = 3 then get where NTYPE = 0...</li>
  </ul>
  
  <p>I can make a procedure that can do this but I would like do it in a select</p>
  
  <p>Is it possible? Any Idea?</p>