 <p>You are trying to add expression in <code>THEN</code> section of <code>CASE</code> while statement is expected. Instead of using <code>CASE</code> try to move conditions to <code>WHERE</code> section:</p> <pre><code>SELECT element FROM elementTable WHERE (date &gt; '2013' AND element NOT IN ('e1', 'e2', 'e3')) OR (date &gt; '2012' AND date &lt;= '2013' AND element NOT IN ('e2', 'e3')) OR (date &gt; '2011' AND date &lt;= '2012' AND element NOT IN ('e3')) OR date &lt;= '2011' </code></pre>