在表中插入数据时在mysql中获取错误

时间:2017-04-28 12:54:44

标签: mysql ip

insert values into emp
("1001","Sahil","Footballer","2017-01-02",10000,99,2),
("1002","Saumya","Army","2017-01-01",10000,100,1),
("1003","Soumya","Doctor","2017-01-03",1000,91,3),
("1004","Rishi","CA","2017-01-04",1001,15,3),
("1005","Anurag","Cricketer","2017-01-05",10001,24,2),
("1006","Ritwik","Don","2017-01-06",10024,13,3),
("1007","Ashish","Manager","2017-01-07",50014,34,4),
("1008","Prateek","Philosopher","2017-01-08",6451,423,4),
("1009","Aniket","Soft Engineer","2017-01-09",5784,901,4),
("1010","Khushi","Musician","2017-01-10",9645,9,2);

收到错误

ERROR 1064 (42000): You have an error in your SQL syntax check the manual that corresponds to your MySQL server version for the right syntax to use near 'values into emp ("1001","Sahil","Footballer","2017-01-02",10000,99,2),
("1002","' at line 1.

请尽快解决此问题

1 个答案:

答案 0 :(得分:1)

我会回答这个问题,尽管粗鲁希望它是语言障碍而不是粗鲁。

正确的语法是:

INSERT INTO emp(身份证,姓名,专业,日期,x,y,z) VALUES(“1001”,“Sahil”,“足球运动员”,“2017-01-02”,10000,99,2), ( “1002”, “Saumya”, “军”, “2017年1月1日”,10000,100,1),

您只是忘记包含要添加值的列名。