在SQL中,INSERT语句用于向数据库表中插入新的行。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语句的常见用法,可以根据具体需求选择适合的方式进行插入操作。