Can I insert multiple records in table by one query in SQL ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Can I insert multiple records in table by one query in SQL ?

30th Dec 2016, 1:26 PM
Dilan Jameel Sulaiman
Dilan Jameel Sulaiman - avatar
9 Answers
+ 7
Yes, sure. You could use the following code: Insert into ... (...) values (your first record), (your second record), and so on. After the last bracket you should use the semicolon.
30th Dec 2016, 1:38 PM
Verena
+ 5
sure..insert into tablename values(1,'john'),(2,'randy'),(3,'goldberg').......we can insert multiple records by using comma(,) between rows.
30th Dec 2016, 6:42 PM
suman reddy
suman reddy - avatar
+ 3
Sure just split them by using a brackets and a ","
30th Dec 2016, 1:31 PM
Andreas K
Andreas K - avatar
+ 2
yes, you can make with INSERT INTO query.
1st Jan 2017, 3:34 AM
suria sarath
suria sarath - avatar
+ 2
yes, sure
13th Jan 2017, 10:48 AM
Ravi Verma
Ravi Verma - avatar
+ 1
Yes you can.
3rd Jan 2017, 1:16 AM
Yesuf
Yesuf - avatar
+ 1
yes using comma,&brackets and finally semicolons to close
6th Jan 2017, 4:29 AM
shibila sherin
+ 1
yes of course by using this query insert into table name values(add values in the same order),(add values in the same order);
13th Jan 2017, 9:44 AM
Mahmoud El Menshawy
Mahmoud El Menshawy - avatar
0
here's a handy trick. if you have data in one table and what to insert into another table such as a temp table you can do insert into [tableName] ([colName],[colName]..) select colName, colName.. from tableName where..
11th Feb 2017, 11:47 AM
Luke T
Luke T - avatar