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
Math,
5 months ago
Computer Science,
5 months ago
CBSE BOARD XII,
5 months ago
Environmental Sciences,
9 months ago
Math,
9 months ago
English,
11 months ago
Science,
11 months ago
Social Sciences,
11 months ago