title: Even or odd in SQL
body: <p>This is table structure</p>
  
  <pre><code>id
  1
  2
  3
  4
  5
  6
  </code></pre>
  
  <p>I need result like this</p>
  
  <pre><code>id  even  odd
  1   0     1
  2   1     0
  3   0     1
  4   1     0
  5   0     1
  6   1     0
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>select id %2=0 then 1 else 0 end or id%2 &lt;&gt;0 then 1 else 0 odd 
  from table
  </code></pre>