Help Center/ CloudTable Service/ User Guide/ Using Doris/ Common SQL Commands of Doris/ Inserting Data
Updated on 2025-11-11 GMT+08:00
Inserting Data
This section describes the basic syntax and usage of the SQL statements for inserting table data in a Doris cluster.
Basic Syntax
INSERT INTO table_name
[ PARTITION (p1, ...) ]
[ WITH LABEL label]
[ (column [, ...]) ]
[ [ hint [, ...] ] ]
{ VALUES ( { expression | DEFAULT } [, ...] ) [, ...] | query } Usage Example
- Create table test.
CREATE TABLE test ( c1 TINYINT, c2 DECIMAL(10, 2) DEFAULT "10.5", ) COMMENT "table comment" DISTRIBUTED BY HASH(k1) BUCKETS 32;
- Create table test2.
CREATE TABLE test2 like test;
- Insert multiple rows of data into the test table at a time.
INSERT INTO test VALUES (1, 2), (3, 4);
- Check whether data is inserted into test2.
SELECT * from test2;
- Import the result of a query statement to the test table.
INSERT INTO test (c1, c2) SELECT * from test2;
Parent topic: Common SQL Commands of Doris
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.