blob: 7a895fcb7d9c115f53f8f01ecfd02a9a63e0fab9 [file] [log] [blame]
--
-- Create new table t
--
CREATE TEMPORARY TABLE t(pid INT, wid INT, state CHARACTER VARYING(30));
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'pid' as the Apache Cloudberry data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
--
-- Insert a row and keep state as empty
--
INSERT INTO t VALUES(1, 1);
--
-- use nested decode
--
SELECT DECODE(DECODE(state, '', NULL, state), '-', NULL, state) AS state FROM t;
state
-------
(1 row)