title: Select one row only if a value exists in another
body: <p>I need a query for wherein data comes from client and main approval records into a mapping table. which first checks for client approval if data is available for client approval, then it should fetch client approval. If no data is available for client then it should fetch main approval records for a particular date. The following query:</p>
  
  <pre><code>SELECT * FROM employee_map
    WHERE DATE = '2013-11-13 00:00:00'
      AND (WORKDAIRY_APPROVAL='ClientApproval' XOR WORKDAIRY_APPROVAL='MainApproval')
  </code></pre>
  
  <p>is giving 2 rows output for 13th date , but if I change the date to 20th I am getting main approval. If both main and client approval are available I need only client approval data.</p>
  
  <pre><code> ------------------------------- --------------------------------------- 
   MAP_ID CATEGORY EMP_ID   DATE       EMP_NAME EMP_SAL APPROVAL
   ------------------------------------------ 
     1    DIRECT    1     11/13/2013    JOHN    5,000  MainApproval
     2    DIRECT    1     11/13/2013    JOHN    5,000  ClientApproval
     3    DIRECT    2     11/20/2013    RAJ     2,000  MainApproval
     4    DIRECT    3     11/21/2013    Ram     1,000  ClientApproval
  </code></pre>
  
  <p>please help me out .</p>