PostgreSQL櫇毕 SQL 湺庖䔇 boolean 昄扞䌂傋㔗boolean 埻脘橬"true"(䩘)潡"false"(啺)婴婻䪽攕幋婔丸婬䓉"unknown"(橻䘖)䪽攕䫘 NULL 臘䴺㔗
"䩘"唚䔇橬昽桺橸唚滇
TRUE |
't' |
'true' |
'y' |
'yes' |
'1' |
FALSE |
'f' |
'false' |
'n' |
'no' |
'0' |
冋8-2. 嘪䫘 boolean 䌂傋
CREATE TABLE test1 (a boolean, b text); INSERT INTO test1 VALUES (TRUE, 'sic est'); INSERT INTO test1 VALUES (FALSE, 'non est'); SELECT * FROM test1; a | b ---+--------- t | sic est f | non est SELECT * FROM test1 WHERE a; a | b ---+--------- t | sic est
冋8-2 滆䴺庖嘪䫘庖應 t 启 f 膷庺 boolean 昄唚䔇冋床㔗
boolean 嘪䫘 1 庖誗庻嗘䷺閘㔗