24
`gender` enum('female','male','rather not say','alien') NOT NULL default 'rather not say',
這是使用枚舉的正確方法嗎?MySQL Enum正確使用?
`gender` enum('female','male','rather not say','alien') NOT NULL default 'rather not say',
這是使用枚舉的正確方法嗎?MySQL Enum正確使用?
是的。更多的信息在這裏http://dev.mysql.com/doc/refman/5.0/en/enum.html
您使用ENUM佔用更少的存儲空間,並且比存儲實際字符串要快得多,因爲MySQL在內部將每個選項都表示爲一個數字。即女= 0,男= 1等
非常感謝您的鏈接。 – 0x60 2011-02-18 04:50:48
這是**定義**枚舉的正確方法。 – zerkms 2011-02-18 04:48:21