title: Can I compare MySQL enums?
body: <p>I have an enumeration: <code>ENUM( 'alpha', 'beta', 'gamma', 'delta', 'omega' )</code></p>
  
  <p>If I sort my table by this column I get them in the correct order defined above.</p>
  
  <p>However, I can't find a way to select a subset of these, e.g. everything before delta. Using <code>WHERE status &lt; 'delta'</code> only returns alpha and beta, not gamma. It seems MySQL uses a string comparison, not enum index comparison.</p>
  
  <p>I could use the index numbers - i.e. <code>WHERE status &lt; 4</code> - but it's a bit of a code smell (magic numbers) and may break if I insert new values into the enumeration.</p>