Computer Science, asked by chiru3126, 11 months ago

How to insert multiple records using single sql command?

Answers

Answered by lekshmi68
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 mpkaur
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