title: Get information from table based in conditions
body: <p>I am having some trouble trying to figure out a way to get some information from a table based in some conditions.</p>
  
  <p>What I am trying to do: Case the CATEGORY column is in A, B, C or D the I would like to get the date from the DATEX column. If the Category is in E, F I would like to get the date from the DATEY column:</p>
  
  <pre><code>SELECT
      COLUMNX
  FROM
      TABLE A
  WHERE
      A.CONDITION1 = A.CONDITION2 AND
      (CASE
      WHEN A.CATEGORY IN ('A', 'B', 'C', 'D') THEN
          A.DATEX = (SELECT ...)
      WHEN A.CATEGORY IN ('E', 'F') THEN
          A.DATEY = (SELECT ...)
      END)
  </code></pre>
  
  <p>But this isn't working, I am getting sintax errors. Any help will be great.</p>