MySQL错误 - 我在这里做错了什么?

时间:2015-02-12 05:38:13

标签: mysql database

   CREATE TABLE myCTGlobalFootprint (
         geoID INT NOT NULL AUTO_INCREMENT, 
         geoName VARCHAR(20) NOT NULL,
         PRIMARY KEY (geoID)
    );


INSERT INTO myCTGlobalFootprint 
     (geoName)

VALUES 
     ('Canada'),
     ('United States'),
     ('Europe'),
     ('International Misc.');

它在第15行引发错误......任何见解都会得到极大的认可!!

1 个答案:

答案 0 :(得分:0)

使用UNION之类的:

INSERT INTO myCTGlobalFootprint (geoName)
select 'Canada'
UNION
select 'United States'
UNION
select 'Europe'
UNION
select 'International Misc.';

否则你必须编写四个INSERT INTO语句,如:

INSERT INTO myCTGlobalFootprint(geoName) VALUES('Canada');
INSERT INTO myCTGlobalFootprint(geoName) VALUES('United States');
INSERT INTO myCTGlobalFootprint(geoName) VALUES('Europe');
INSERT INTO myCTGlobalFootprint(geoName) VALUES('International Misc.');