SELECT options for MySQL Enum field  

I needed to display the valid options for a MySQL Enum field. Table and column metadata is stored in a virtual table called INFORMATION_SCHEMA and can be queried with normal selects. To see the options for a given enum field do:

SELECT column_type FROM information_schema.columns WHERE table_name = 'MyTable' AND column_name = 'MyColumn';
Leave A Reply
All content licensed under the Creative Commons License