Updated on 2026-11-06 GMT+08:00
Boolean Type
| Type | Description | Storage Space | Value |
|---|---|---|---|
| BOOLEAN | Boolean type | 1 byte. |
|
- Valid text literals for true: TRUE, 't', 'true', 'y', 'yes', and '1'.
- Valid text literals for false: FALSE, 'f', 'false', 'n', 'no', and '0'.
Using TRUE and FALSE is more standardized (and SQL-compliant).
Example
Display boolean values with the letters t and f.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | -- Create a table. CREATE TABLE bool_type_t1 ( BT_COL1 BOOLEAN, BT_COL2 TEXT ) STORE AS orc; -- Insert data. INSERT INTO bool_type_t1 VALUES (TRUE, 'sic est'); INSERT INTO bool_type_t1 VALUES (FALSE, 'non est'); -- View data. SELECT * FROM bool_type_t1; bt_col1 | bt_col2 ---------+--------- t | sic est f | non est (2 rows) SELECT * FROM bool_type_t1 WHERE bt_col1 = 't'; bt_col1 | bt_col2 ---------+--------- t | sic est (1 row) -- Drop the table. DROP TABLE bool_type_t1; |
Parent topic: Data Type
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot