MySQL Boolean “tinyint(1)” holds values up to 127?

后端 未结 4 1469
感情败类
感情败类 2020-12-05 02:32

I wanted to make a true/false field for if an item is in stock.

I wanted to set it to Boolean ( which gets converted to tinyint(1) ), 1 for in stock, 0

4条回答
  •  青春惊慌失措
    2020-12-05 02:34

    The signed TINYINT data type can store integer values between -128 and 127.

    However, TINYINT(1) does not change the minimum or maximum value it can store. It just says to display only one digit when values of that type are printed as output.

提交回复
热议问题