在Clickhouse中,可以使用INSERT查詢語句來插入數(shù)據(jù)到表中。以下是一個(gè)詳細(xì)的示例教程:
test_table
的表,包含兩個(gè)字段id
和name
:CREATE TABLE test_table (
id UInt32,
name String
) ENGINE = MergeTree ORDER BY id;
INSERT INTO test_table (id, name) VALUES (1, 'John');
INSERT INTO test_table (id, name) VALUES (2, 'Alice'), (3, 'Bob');
source_table
中選擇數(shù)據(jù)插入到test_table
:INSERT INTO test_table (id, name) SELECT id, name FROM source_table;
SELECT * FROM test_table;
通過以上步驟,您可以成功創(chuàng)建表并插入數(shù)據(jù)到Clickhouse表中。希望這個(gè)教程對(duì)您有幫助!