title: UNION with IF statements
body: <p>I'm writing a query that does various checks on database tables and returns a summary of the result(in a single result set)</p>
  
  <pre><code>IF ( select COUNT(*) from member_table WHERE password IS NULL ) &gt; 0
     SELECT 'password check' as name, 'ERROR' as result ,'there is user(s) with blank password' as description
  ELSE
     SELECT 'password check' as name, 'COMPLETED' as result, 'OK' as description
  
  UNION
  
  IF ( select COUNT(*) from server_context_properties ) = 0
     SELECT 'context properties check' as name, 'ERROR' as result ,'no context property has been entered' as description
  ELSE
     SELECT 'context properties check' as name, 'COMPLETED' as result, 'OK' as description
  </code></pre>
  
  <p>the result table should look like this:</p>
  
  <pre><code>name                    result  description
  password check          COMPLETED   OK
  contex properties check ERROR       no context property has been entered
  </code></pre>
  
  <p>I know that the syntax is incorrect, but I can't think of any way to achieve this.</p>