The SET Type Enumeration Limitations 11.3.6 The SET Type ENUM(’b’, ’a’) . The empty string sorts before nonempty strings, and  NULL  values sort before all other enumeration values. To prevent unexpected results when using the  ORDER BY  clause on an  ENUM  column, use one of these techniques: An enumeration value cannot be an expression, even one that evaluates to a string value. For example, this  CREATE TABLE  statement does  not  work because the  CONCAT  function cannot be used to construct an enumeration value: You also cannot employ a user variable as an enumeration value. This pair of statements do  not  work: We strongly recommend that you do  not  use numbers as enumeration values, because it does not save on storage over the appropriate  TINYINT  or  SMALLINT  type, and it is easy to mix up the strings and the underlying number values (which might not be the same) if you quote the  ENUM  values incorrectly. If you do use a number as an enumeration value, always enclose it in quotation marks. If the quotation marks are omitted, the number is regarded as an index. See Handling of Enumeration Literals to see how even a quoted number could be mistakenly used as a numeric index value. Duplicate values in the definition cause a warning, or an error if strict SQL mode is enabled. A  SET  is a string object that can have zero or more values, each of which must be chosen from a list of permitted values specified when the table is created.  SET  column values that consist of multiple set members are specified with members separated by commas ( , ). A consequence of this is that  SET member values should not themselves contain commas. For example, a column specified as  SET(’one’, ’two’) NOT NULL  can have any of these values: A  SET  column can have a maximum of 64 distinct members. Duplicate values in the definition cause a warning, or an error if strict SQL mode is enabled. Trailing spaces are automatically deleted from  SET  member values in the table definition when a table is created. ’’ ’one’ ’two’ ’one,two’ 2046 SET @mysize = ’medium’; CREATE TABLE sizes ( size ENUM(’small’, @mysize, ’large’) ); CREATE TABLE sizes ( size ENUM(’small’, CONCAT(’med’,’ium’), ’large’) ); •Specify the  ENUM  list in alphabetic order. •Make sure that the column is sorted lexically rather than by index number by coding  ORDER BY CAST( col  AS CHAR)  or  ORDER BY CONCAT( col ) .