性别是一个Bool值,但我不知道如何插入其值下面是我写的
INSERT INTO用户(user_id,user_name,加入,密码,first_name,last_name,date_of_birth,性别)VALUES('150/08','Otollo',NOW(),SHA('WUODBABA'),'Joshua','Abuto ','1998-08-23',
使用真假如
INSERT INTO users (user_id, user_name, joined, password, first_name, last_name, date_of_birth, gender) VALUES ('150/08', 'Otollo', NOW(), SHA('WUODBABA'), 'Joshua', 'Abuto', '1998-08-23',TRUE)
并使用此链接检查所有可能的方式插入bool值
http://www.postgresql.org/docs/8.1/static/datatype-boolean.html
只需将 TRUE 或 FALSE 如下所示
TRUE
FALSE
Here you can find more information
你可以做到这一点 .
我不知道您对该性别列的数据类型 .
I am assuming that your column datatype is bit
你只需要在数据库中为性别列传递0和1 .
INSERT INTO users (user_id, user_name, joined, password, first_name, last_name, date_of_birth, gender) VALUES ('150/08', 'Otollo', NOW(), SHA('WUODBABA'), 'Joshua', 'Abuto', '1998-08-23',0 OR 1)
3 回答
使用真假如
并使用此链接检查所有可能的方式插入bool值
http://www.postgresql.org/docs/8.1/static/datatype-boolean.html
只需将
TRUE
或FALSE
如下所示Here you can find more information
你可以做到这一点 .
我不知道您对该性别列的数据类型 .
I am assuming that your column datatype is bit
你只需要在数据库中为性别列传递0和1 .