RosettaCodeData/Task/Logical-operations/DuckDB/logical-operations.duckdb
2025-08-11 18:05:26 -07:00

22 lines
416 B
Text

create or replace function demo(p, q) as table (
select p as p,
q as q,
p and q as and,
p or q as or,
not p as "NOT p",
(p is TRUE) as "p is TRUE",
(p is NULL) as "p is NULL"
);
# Some examples
from demo(0, 0)
union all
from demo(0, 1)
union all
from demo(true, true)
union all
from demo(0, null)
union all
from demo(1, null)
union all
from demo(null, null);