Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

how to copy data in sql

INSERT INTO my_table my
SELECT * FROM another_table an
WHERE an.col1 > 10;

INSERT INTO my_table (colA, colB) 
SELECT an.col1 AS colA, an.col2 AS colB FROM another_table an
WHERE an.col1 > 10;
 
PREVIOUS NEXT
Tagged: #copy #data #sql
ADD COMMENT
Topic
Name
7+4 =