How to insert multiple records using single sql command?
Answers
Answered by
0
Answer:
One can also insert multiple rows into a table with a single insert query at once. To do this, include multiple lists of column values within the INSERT INTO statement where column values for each row must be enclosed within parentheses and by a comma.
Answered by
0
Answer:
You can use INSERT with SELECT UNION ALL: INSERT INTO My Table (First Column, Second Column) SELECT 'First' ,1 UNION ALL SELECT 'Second' ,2 UNION ALL SELECT 'Third' ,3 ... Only for small data sets though, which should be fine for your 4 records. INSERT statements that use VALUES syntax can insert multiple rows.
Similar questions
Biology,
6 months ago
Math,
6 months ago
Geography,
6 months ago
Environmental Sciences,
11 months ago
Math,
11 months ago
English,
1 year ago
Social Sciences,
1 year ago