Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is difference between insert value and insert values in mysql statement?

Tags:

mysql

pdo

Please, tell me difference between below mysql statement:

INSERT INTO test (first_name,last_name,age) VALUE (:i_first_name,:i_last_name,:i_age), (:i_first_name,:i_last_name,:i_age);

and

INSERT INTO test (first_name,last_name,age) VALUES (:i_first_name,:i_last_name,:i_age), (:i_first_name,:i_last_name,:i_age);

Both are working fine.

like image 945
Nono Avatar asked Jul 03 '13 10:07

Nono


People also ask

What is the main difference between the two insert commands?

If you are using Insert or Insert into both will insert the data in Table. However Insert into is basically used to fatch the data from another table using select command and insert into table where you want to insert the data.

What is insert in MySQL?

MySQL INSERT statement is used to store or add data in MySQL table within the database. We can perform insertion of records in two ways using a single query in MySQL: Insert record in a single row. Insert record in multiple rows.

Which SQL statement is used to insert value?

The INSERT INTO statement is used to insert new records in a table.

What is the difference between insert and UPDATE operations?

Insert is for adding data to the table, update is for updating data that is already in the table.


1 Answers

There is no difference, as you can see from the syntax rules here, both keywords are valid: http://dev.mysql.com/doc/refman/5.5/en/insert.html

like image 78
CBroe Avatar answered Sep 25 '22 19:09

CBroe