此查询有什么问题?我正在尝试创建一个具有一些主要ID的练习小表格来进行匹配,但我在这里找不到错误

时间:2019-04-25 15:24:14

标签: mysql mysql-workbench mysql-error-1241

小表格以进行ID匹配。

CREATE DATABASE test_1;
USE test_1;

CREATE TABLE test_items(

contact_id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR (20) ,
last_name VARCHAR (20),
PRIMARY KEY (contact_id)
);

INSERT INTO test_items()

VALUES (
(NULL, 'Javier','Droid'),
(NULL,'Gret','Jun'),
(null,'Kilot','Ramirez')

);
SELECT * FROM test_items;

1 个答案:

答案 0 :(得分:1)

始终指定要插入的列名:

INSERT INTO test_items(first_name, last_name)  
VALUES ('Javier','Droid'), ('Gret','Jun'), ('Kilot','Ramirez'); 

SELECT * FROM test_items;