Use the INSERT statement to insert data into an existing table.
Example:
Create Table t1 that contains the following data:
obclient> CREATE TABLE t1(c1 int primary key, c2 int) partition BY key(c1) partitions 4;
Query OK, 0 rows affected (0.11 sec)
Insert a row of data into Table t1.
obclient> INSERT INTO t1 VALUES(1,1); Query OK, 1 row affected (0.01 sec) obclient> SELECT * FROM t1; +----+------+ | c1 | c2 | +----+------+ | 1 | 1 | +----+------+ 1 row in set (0.04 sec)Insert two or more rows of data into Table t1.
obclient> INSERT t1 VALUES(1,1),(2,default),(2+2,3*4); Query OK, 3 rows affected (0.02 sec) Records: 3 Duplicates: 0 Warnings: 0 obclient> SELECT * FROM t1; +----+------+ | c1 | c2 | +----+------+ | 1 | 1 | | 2 | NULL | | 4 | 12 | +----+------+ 3 rows in set (0.02 sec)
For more information on the syntax of the INSERT statement, see the "INSERT" topic in SQL Reference (MySQL Mode).