title: case when mysql with multiple conditions
body: <p>I made the following case when statement in my sql:</p>
  
  <pre><code>SELECT 
  *,
  CASE
      WHEN lead_time &lt; 14 THEN 0
      WHEN (14 &lt;= lead_time &lt; 21 AND days_passed = 8) THEN 1
      WHEN
          (21 &lt;= lead_time &lt; 28
              AND days_passed = 15)
      THEN
          1
      WHEN
          (28 &lt;= lead_time &lt; 42
              AND days_passed = 22)
      THEN
          1
      WHEN
          (42 &lt;= lead_time &lt; 56
              AND days_passed = 36)
      THEN
          1
      WHEN
          (56 &lt;= lead_time &lt; 84
              AND days_passed = 29)
      THEN
          1
      WHEN
          (56 &lt;= lead_time &lt; 84
              AND days_passed = 50)
      THEN
          1
      WHEN (lead_time &gt; 84 AND days_passed = 36) THEN 1
      WHEN (lead_time &gt; 84 AND days_passed = 57) THEN 1
      ELSE 0
  END AS send_email
  </code></pre>
  
  <p>I do not get any error. However, when I check the results I get:</p>
  
  <pre><code># lead_time, days_passed, send_email
  99, 15, 1
  99, 22, 1
  99, 15, 1
  99, 8, 1
  99, 8, 1
  99, 8, 1
  99, 8, 1
  85, 29, 1
  57, 50, 1
  18, 36, 1
  99, 22, 1
  99, 22, 1
  99, 22, 1
  99, 22, 1
  99, 22, 1
  15, 15, 1
  15, 15, 1
  99, 8, 1
  99, 8, 1
  99, 8, 1
  99, 8, 1
  </code></pre>
  
  <p>It seems as if the 'and' in the query behaves as an 'or'. Any idea why?.
  Thanks,</p>