What is the difference between BIT and TINYINT in MySQL?

前端 未结 6 974
耶瑟儿~
耶瑟儿~ 2020-11-29 00:10

In which cases would you use which? Is there much of a difference? Which I typically used by persistence engines to store booleans?

6条回答
  •  一个人的身影
    2020-11-29 00:31

    A TINYINT is an 8-bit integer value, a BIT field can store between 1 bit, BIT(1), and 64 bits, BIT(64). For a boolean values, BIT(1) is pretty common.

提交回复
热议问题