Boolean Values bool (boolean)
Type bool
is stored as UInt8. Possible values true
(1), false
(0).
select true as col, toTypeName(col);
ββcolβββ¬βtoTypeName(true)ββ
β true β Bool β
ββββββββ΄βββββββββββββββββββ
select true == 1 as col, toTypeName(col);
ββcolββ¬βtoTypeName(equals(true, 1))ββ
β 1 β UInt8 β
βββββββ΄ββββββββββββββββββββββββββββββ
CREATE TABLE test_bool
(
`A` Int64,
`B` Bool
)
ENGINE = Memory;
INSERT INTO test_bool VALUES (1, true),(2,0);
SELECT * FROM test_bool;
ββAββ¬βBββββββ
β 1 β true β
β 2 β false β
βββββ΄ββββββββ