MySQL - Difference between Char and Varchar? [duplicate]
Possible Duplicate:
What's the difference between VARCHAR and CHAR?
what is the difference between开发者_JAVA技巧 CHAR and VARCHAR.
A CHAR field is a fixed length, and VARCHAR is a variable length field.
This means that the storage requirements are different - a CHAR always takes the same amount of space regardless of what you store, whereas the storage requirements for a VARCHAR vary depending on the specific string stored.
VARCHAR
stores a variable number of bytes for only the space required by the content.
CHAR
stores a fixed size of however many bytes you specify for your table, no matter how many characters occupy a field of this type per row.
精彩评论