title: query to get season specific data plus neutral objects
body: <p>I am trying to create query which delivers id of <code>Childerens</code> the important thing is we have season specific Childrens and neutral on. The <code>Childrens</code> table has a field named <code>season</code> which may have a value of 0,1 or 2</p>
  
  <pre><code>0 means Neutral / Season independet
  1 means only for Summer
  2 means only for Winter
  </code></pre>
  
  <p>Then it has 4 next fields <code>summer_from</code>, <code>summer_till</code>, <code>winter_from</code> and <code>winter_till</code></p>
  
  <p>I need to get all the Child object which have either season = 0 plus winter or summer specific object.</p>
  
  <p>Here is my sample query which I am generating dynamically using scripting language. I have removed the script code as much as possible. </p>
  
  <p>Is there a better way to write this query?</p>
  
  <pre><code>SELECT id
  FROM Childrens
  WHERE id_parent= 2656
  ## if the parameter 'season' is 1 or 2 then we will access
  if(season == 1)
    AND Now() &gt;= summer_from
    AND Now() &lt;= summer_till
  elseif ( season == 2 )
    AND Now() &gt;= winter_from
    AND Now() &lt;= winter_till
  
  
  UNION 
  
  SELECT id
  FROM Childrens
  WHERE id_parent= 2656
  AND season = 0
  AND ( 
       ( NOW() &gt;= summer_from AND  NOW() &lt;= summer_till) 
       OR
      ( NOW() &gt;= winter_from AND  NOW() &lt;= winter_till)
  )
  </code></pre>