mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
62 lines
1.7 KiB
SQL
62 lines
1.7 KiB
SQL
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested (x UInt8, n Nested(a UInt64, b String)) ENGINE = TinyLog;
|
|
|
|
INSERT INTO nested VALUES (1, [2, 3], ['Hello', 'World']);
|
|
INSERT INTO nested VALUES (4, [5], ['Goodbye']);
|
|
|
|
SELECT * FROM nested ORDER BY x;
|
|
SELECT x, n.a FROM nested ORDER BY x;
|
|
SELECT n.a, n.b FROM nested ORDER BY n.a;
|
|
|
|
|
|
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested (x UInt8, n Nested(a UInt64, b String)) ENGINE = Log;
|
|
|
|
INSERT INTO nested VALUES (1, [2, 3], ['Hello', 'World']);
|
|
INSERT INTO nested VALUES (4, [5], ['Goodbye']);
|
|
|
|
SELECT * FROM nested ORDER BY x;
|
|
SELECT x, n.a FROM nested ORDER BY x;
|
|
SELECT n.a, n.b FROM nested ORDER BY n.a;
|
|
|
|
|
|
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested (x UInt8, n Nested(a UInt64, b String)) ENGINE = StripeLog;
|
|
|
|
INSERT INTO nested VALUES (1, [2, 3], ['Hello', 'World']);
|
|
INSERT INTO nested VALUES (4, [5], ['Goodbye']);
|
|
|
|
SELECT * FROM nested ORDER BY x;
|
|
SELECT x, n.a FROM nested ORDER BY x;
|
|
SELECT n.a, n.b FROM nested ORDER BY n.a;
|
|
|
|
|
|
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested (x UInt8, n Nested(a UInt64, b String)) ENGINE = Memory;
|
|
|
|
INSERT INTO nested VALUES (1, [2, 3], ['Hello', 'World']);
|
|
INSERT INTO nested VALUES (4, [5], ['Goodbye']);
|
|
|
|
SELECT * FROM nested ORDER BY x;
|
|
SELECT x, n.a FROM nested ORDER BY x;
|
|
SELECT n.a, n.b FROM nested ORDER BY n.a;
|
|
|
|
|
|
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested (x UInt8, n Nested(a UInt64, b String)) ENGINE = MergeTree ORDER BY x;
|
|
|
|
INSERT INTO nested VALUES (1, [2, 3], ['Hello', 'World']);
|
|
INSERT INTO nested VALUES (4, [5], ['Goodbye']);
|
|
|
|
SELECT * FROM nested ORDER BY x;
|
|
SELECT x, n.a FROM nested ORDER BY x;
|
|
SELECT n.a, n.b FROM nested ORDER BY n.a;
|
|
|
|
|
|
DROP TABLE nested;
|