SQL INSERT INTO SELECT Statement


With SQL, you can copy information from one table into another.

The INSERT INTO SELECT statement copies data from one table and inserts it into an existing table.


The SQL INSERT INTO SELECT Statement

The INSERT INTO SELECT statement selects data from one table and inserts it into an existing table. Any existing rows in the target table are unaffected.

SQL INSERT INTO SELECT Syntax

We can copy all columns from one table to another, existing table:

INSERT INTO table2
SELECT * FROM table1;

Or we can copy only the columns we want to into another, existing table:

INSERT INTO table2
(column_name(s))
SELECT column_name(s)
FROM table1;

 

Pate family sports – Spring 2015

Sun 3/8/2015 7:00 PM Cedar Rock Paul Soccer
Sun 3/8/2015 7:20 PM MVP Paul Soccer
Tue 3/10/2015 7:30 PM Cedar Rock Paul Soccer
Thu 3/12/2015 8:20 PM Coit Erin Volleyball
Thu 3/12/2015 9:00 PM Cedar Rock Nathan Soccer
Sun 3/15/2015 3:40 PM MVP Paul Soccer
Thu 3/19/2015 8:00 PM Cedar Rock Nathan Soccer
Thu 3/19/2015 TBD YMCA Erin Volleyball Playoffs
Sun 3/22/2015 6:25PM MVP Paul Soccer
Thu 3/26/2015 7:00 PM Cedar Rock Nathan Soccer
Sun 3/29/2015 8:15 PM MVP Paul Soccer
Tue 3/31/2015 8:30 PM Cedar Rock Paul Soccer
Sun 4/11/2015 10:00 AM Rezevior Subbuteo – Spring Classic
Tue 4/14/2015 8:20 PM MVP Paul Soccer
Sat 4/18/2015 4:30 PM Meadowridge Nathan Soccer
Fri 4/24/2015 TBD Kellogg Arena Emily – State Meet
Sun 4/26/2015 8:00 AM MVP Fieldhouse Nathan Soccer
Sun 4/26/2015 4:35 PM MVP Paul Soccer
Sat 5/2/2015 10:00 AM TBD Subbuteo – Flicko de Mayo
Sat 5/2/2015 3:00 PM Freshman Center Nathan Soccer
Sun 5/3/2015 6:00 PM Meadowridge Nathan Soccer
Sun 5/3/2015 7:45 PM MVP Paul Soccer
Sun 5/31/2015 6:00 PM Helder Park Nathan Soccer
Sat 6/6/2015 3:30 PM Freshman Center Nathan Soccer
Sun 6/7/2015 1:00 PM Porter/Smitty Nathan Soccer