Which MySQL data type to use for storing boolean values

前端 未结 13 1755
感情败类
感情败类 2020-11-22 04:45

Since MySQL doesn\'t seem to have any \'boolean\' data type, which data type do you \'abuse\' for storing true/false information in MySQL?

Especially in the context

13条回答
  •  不知归路
    2020-11-22 05:17

    After reading the answers here I decided to use bit(1) and yes, it is somehow better in space/time, BUT after a while I changed my mind and I will never use it again. It complicated my development a lot, when using prepared statements, libraries etc (php).

    Since then, I always use tinyint(1), seems good enough.

提交回复
热议问题