title: query on self defined variable
body: <p>How do I query on a self-defined variable?
  Example:</p>
  
  <pre><code>SELECT *, MID(dateandtime, 12, 2) as 'xxx'
  FROM xyz
  WHERE year = '18-19'
  AND xxx &gt; 18
  </code></pre>
  
  <p>Is there a way to use xxx in the query like in the last line of the example?</p>