2018-06-07 20:37:16 +00:00
|
|
|
SELECT CAST(1 AS Enum8('hello' = 1, 'world' = 2));
|
|
|
|
SELECT cast(1 AS Enum8('hello' = 1, 'world' = 2));
|
|
|
|
|
|
|
|
SELECT CAST(1, 'Enum8(\'hello\' = 1, \'world\' = 2)');
|
|
|
|
SELECT cast(1, 'Enum8(\'hello\' = 1, \'world\' = 2)');
|
|
|
|
|
|
|
|
SELECT CAST(1 AS Enum8(
|
2019-06-07 15:41:24 +00:00
|
|
|
'hello' = 1,
|
2018-06-07 20:37:16 +00:00
|
|
|
'world' = 2));
|
|
|
|
|
|
|
|
SELECT cast(1 AS Enum8(
|
|
|
|
'hello' = 1,
|
|
|
|
'world' = 2));
|
|
|
|
|
|
|
|
SELECT CAST(1, 'Enum8(\'hello\' = 1,\n\t\'world\' = 2)');
|
|
|
|
SELECT cast(1, 'Enum8(\'hello\' = 1,\n\t\'world\' = 2)');
|
|
|
|
|
2018-10-15 15:10:34 +00:00
|
|
|
SELECT toTimeZone(CAST(1 AS TIMESTAMP), 'UTC');
|
|
|
|
|
2019-06-07 15:41:24 +00:00
|
|
|
DROP TABLE IF EXISTS cast;
|
|
|
|
CREATE TABLE cast
|
2018-06-07 20:37:16 +00:00
|
|
|
(
|
|
|
|
x UInt8,
|
|
|
|
e Enum8
|
|
|
|
(
|
|
|
|
'hello' = 1,
|
|
|
|
'world' = 2
|
|
|
|
)
|
|
|
|
DEFAULT
|
|
|
|
CAST
|
|
|
|
(
|
|
|
|
x
|
|
|
|
AS
|
|
|
|
Enum8
|
|
|
|
(
|
|
|
|
'hello' = 1,
|
|
|
|
'world' = 2
|
|
|
|
)
|
|
|
|
)
|
|
|
|
) ENGINE = MergeTree ORDER BY e;
|
|
|
|
|
2019-06-07 15:41:24 +00:00
|
|
|
SHOW CREATE TABLE cast FORMAT TSVRaw;
|
|
|
|
DESC TABLE cast;
|
2019-06-04 12:35:31 +00:00
|
|
|
|
2019-06-07 15:41:24 +00:00
|
|
|
INSERT INTO cast (x) VALUES (1);
|
|
|
|
SELECT * FROM cast;
|
2018-06-07 20:37:16 +00:00
|
|
|
|
2019-06-07 15:41:24 +00:00
|
|
|
DROP TABLE cast;
|