Skip to content
Advertisement

Multiple inserts of multi-valued subqueries

I found the single insert answer from this question: How can I insert values into a table, using a subquery with more than one result?. However, I’m looking for a way to do multiple inserts in this fashion.

Single-Insert version WORKING! (using the previous answer…):

Multi-Insert version (Failing)

Is there a method of doing these multiple inserts of multi-column subqueries with a simple-enough syntax?

Thanks!

Advertisement

Answer

You can use UNION ALL. It does a union of the two result sets while keeping duplicates.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement