有没有一种快速简便的方法可以将 varchar/char 转换为枚举?我试图这样做,但它不起作用
alter table zipcodes add column state_short_enum enum(
(select state_short from zipcodes group by state_short)
)
我收到此错误:
#1064 - You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near
'(select state_short from zipcodes group by state_short))' at line 1