title: Oracle query return one row based on column values
body: <p>I currently have a query that selects multiple rows of data for the application in the WHERE clause:</p>
  
  <pre><code>SELECT
      APP_NAME,
      NAME,
      ROLE
  FROM APP_PERSON
  WHERE APP_NAME='ABCD'
  ORDER BY APP_NAME,NAME
  </code></pre>
  
  <p>This returns:</p>
  
  <pre><code> ABCD    Bob    Executive Director
   ABCD    Kim    Director
   ABCD    Sara   Associate Director
   ABCD    Tim    VP
  </code></pre>
  
  <p>What I'd like is for this to return one row, with the person that is the lowest titled 'Role'. The order goes: Associate Director, Director, Executive Director, VP (These are the only options).</p>
  
  <p>So for the example above, the only row I'd like returned is:</p>
  
  <pre><code>ABCD   Sara   Associate Director
  </code></pre>
  
  <p>If there wasn't an Associate Director, I'd want Director. How can I create a query that will do this. I'm assuming some kind of DECODE but wasn't sure where to go with it. Thanks for any help!</p>