Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

sql insert multiple rows from select

INSERT INTO my_table SELECT * FROM source_table;
INSERT INTO my_table (a, b, c) SELECT a, b, c FROM source_table;
INSERT INTO my_table (a, b, c) SELECT a, b, c FROM source_table s
	WHERE s.my_col >= 10;
 
PREVIOUS NEXT
Tagged: #sql #insert #multiple #rows #select
ADD COMMENT
Topic
Name
6+9 =