title: Advanced trigger with SELECT inside CASE instruction
body: <p>I'm doing trigger and depending on data inserted, I want to compare the input of data to select.
  I have 3 columns col1, col2 and col3 (only one of them can be not null). When I insert data to table, I want to check if data joined to that column is correct.</p>
  
  <p>I tried <code>CASE</code> but it didn't work.</p>
  
  <pre class="lang-sql prettyprint-override"><code>CASE
      WHEN col1 IS NOT NULL THEN SELECT * FROM XXX
      WHEN col2 IS NOT NULL THEN SELECT * FROM YYY
      WHEN col3 IS NOT NULL THEN SELECT * FROM ZZZ LEFT JOIN aaa ON col3.id=aaa.id
      ELSE NULL
  END
  </code></pre>