문제

What's the most appropriate (read least data consuming) data field to store a true/false/1/0 value in a mySQL database?

I have previously used a one character long tinyint, but I am not sure if it's the best solution?

Thanks!

도움이 되었습니까?

해결책

tinyint(1)

Is basically aliased from the BOOL data type so it is fine.

See here

In addition, this has already been covered here:

Which MySQL data type to use for storing boolean values

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top