开发者

MySQL - Difference between Char and Varchar? [duplicate]

This question already has answers here: Closed 12 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜