SQL Boolean Types
Name | Description | Syntax | Aliases |
---|---|---|---|
boolean |
state of true or false |
|
|
CREATE TABLE TEST_BOOLEAN (col_1 boolean, col2 string);
INSERT INTO TEST_BOOLEAN VALUES (TRUE, 'True Value');
INSERT INTO TEST_BOOLEAN VALUES (FALSE, 'False Value');
SELECT * FROM TEST_BOOLEAN;
COL_1 COL2
------ -----------
TRUE True Value
FALSE False Value
SELECT * FROM TEST_BOOLEAN WHERE Col_1;
COL_1 COL2
------ ----------
TRUE True Value
SELECT * FROM TEST_BOOLEAN WHERE not Col_1;
COL_1 COL2
------ -----------
FALSE False Value
select 1 and 0 from dual;
-----
FALSE