v.19.1Improvements
Allowed to Use Enums as Integers Inside If Function
Why it matters
This feature enables more flexible usage ofEnum values by allowing them to be treated as integers within conditional expressions. This solves the limitation where Enum types could not be directly used as integer values in the if function, enhancing query expressiveness and simplifying code.How to use it
Simply useEnum values within the if function as you would with integers. For example:SELECT if(some_enum_column = EnumValue, 1, 0) FROM table