Insert Into Location
('Amman' , 'Sweleh' , 'Jordan') ,
('Zarqa' , 'Hussen' , 'Jordan') ,
('Jerash' , 'jenna' , 'Jordan') ,
('Ajloun' , 'shajra' , 'Jordan'),
('Irbid' , 'Hoson' , 'Jordan') ;
Asked
Active
Viewed 465 times
-4

marc_s
- 732,580
- 175
- 1,330
- 1,459
3 Answers
2
You have syntax error, you have missed VALUES
keyword. If you want to omit the fieldname then try this:
INSERT INTO Location
VALUES
('Amman' , 'Sweleh' , 'Jordan') ,
('Zarqa' , 'Hussen' , 'Jordan') ,
('Jerash' , 'jenna' , 'Jordan') ,
('Ajloun' , 'shajra' , 'Jordan'),
('Irbid' , 'Hoson' , 'Jordan');
Or use this format :
INSERT INTO table(column1,column2...)
VALUES (value1,value2,...),
(value1,value2,...),
...
for more information read this mysql-insert-multiple-records

Rakesh Shetty
- 4,548
- 7
- 40
- 79
-
The syntax for inserting multiple records in SQL server (which is OP tag) happens to be the same with mySQL systax..However For precision matter it would be better if you provided a link for SQL Server – apomene Sep 05 '14 at 12:59
1
The correct syntax of an INSERT STATEMENT statement is:
insert into tableName (field1Name,...,FieldnName) values (value1,...,valuen)
Furthermore if you want to insert multipbe records in a singe query have a look at this
-
-
Sorry I dont quite get what you mean..If he is missining values keyword then the syntax is wrong.. – apomene Sep 05 '14 at 12:54
-
yes im not saying that query is right but he has missed VALUES keyword. Without adding fieldname also we can insert the values – Rakesh Shetty Sep 05 '14 at 12:58
0
Correct syntax :
insert into tableName (field1Name) values (fieldNamevalue1)

Rakesh Shetty
- 4,548
- 7
- 40
- 79

Maharshi
- 1,178
- 1
- 14
- 37