Updated on 2024-10-09 GMT+08:00

INSERT INTO

This section describes the basic syntax and usage of SQL statements for inserting table data to the Doris.

Basic Syntax

INSERT INTO table_name

[ PARTITION (p1, ...) ]

[ WITH LABEL label]

[ (column [, ...]) ]

[ [ hint [, ...] ] ]

{ VALUES ( { expression | DEFAULT } [, ...] ) [, ...] | query }

Use Example

  • Insert multiple rows of data into the test table at a time.

    INSERT INTO test VALUES (1, 2), (3, 4);

  • Import the result of a query statement to the test table.

    INSERT INTO test (c1, c2) SELECT * from test2;