Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql insert multiple rows based on select

INSERT INTO table1 (col1, col2, col3, col4, col5) 
SELECT col1,col2,col3,col4,col5 
FROM table2 t2 
WHERE t2.val2 IN (MULTIPLE VALUES) 
AND (Another Conditional);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #insert #multiple #rows #based #select
ADD COMMENT
Topic
Name
6+2 =