是否有將varchar/char轉換爲枚舉的簡單方法?我試圖做到這一點,但它不工作將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