<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>

You can use
```
FIELD(column, "string1", "string2", ...)
```
to find rows with any particular subset of possible
```
ENUM
```
values.
```
```
SELECT * FROM `table` WHERE FIELD(`enum_column`, "alpha", "delta", "et cetera");
```
```
If you want to use the range version, you can use
```
FIND_IN_SET("needle", "hay,stack")
```
to return the index but you'll have to extract the ENUM list out of the table definition first with another query.