대충이라도 하자

MySQL에서 boolean 본문

꼬꼬마 개발자 노트/SQL

MySQL에서 boolean

Sueeeeee
반응형

From Mysql Ver. 5, data can be stored as boolean type.

The problem is when you check on mysql database,

it is not stored as true or false, but stored as 1 or 0.

 

In fact, it is not boolean type. It is TINYINT(1).

Therefore, when you bring the data, you should use 1 or 0. 

 

OR 

IF(<Column name> , 'true', 'false') as <Column name>

 

반응형
Comments