在SQL中,INSERT語句用于向數(shù)據(jù)庫表中插入新的行。INSERT語句的用法有以下幾種:
例如:INSERT INTO customers VALUES (1, ‘John’, ‘Doe’, ‘john@example.com’);
例如:INSERT INTO customers (id, first_name, last_name, email) VALUES (1, ‘John’, ‘Doe’, ‘john@example.com’);
例如:INSERT INTO customers (id, first_name, last_name, email) VALUES (1, ‘John’, ‘Doe’, ‘john@example.com’), (2, ‘Jane’, ‘Smith’, ‘jane@example.com’);
例如:INSERT INTO customers (id, first_name, last_name, email) SELECT id, first_name, last_name, email FROM new_customers;
這些是INSERT語句的常見用法,可以根據(jù)具體需求選擇適合的方式進(jìn)行插入操作。