Insert values from one SQL table into a second one

1146480 pts.
Tags:
SQL
In SQL, can I insert all of the values from one table into another one? Can I just used the INSERT statement for this? Thanks!
1

Answer Wiki

Thanks. We'll let you know when a new response is added.
INSERT INTO new_table (columns….)
SELECT columns….
FROM initial_table where column=value

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    Along with your insert, you need a select command or define the values. Post your code and we will take a look..

    133,790 pointsBadges:
    report
  • CharlieBrowne
    If the field names and definitions are the same and the fields are in the same sequence, it is a simple INSERT instruction. Else, it is still easy, just need to match the source and target fields, 
    62,385 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: