How to copy columns from one table into another table

Example:

INSERT INTO staff( firstName, lastName, address, homePhone, cellPhone, latitude, longitude )
SELECT firstName, lastName, address, homePhone, cellPhone, latitude, longitude
FROM gfxContact

Advertisements

8 Responses to “How to copy columns from one table into another table”

  1. Snap Says:

    Hi,

    I want to copy just one column to another existing table.

    How would I do this?

    I want to copy the content of urlmybutton in ats_members to mybutton_url in ats_sites

    Can you help?

  2. Achshar Says:

    @ snap i know i am a few years late but if any body else needs it..
    INSERT INTO ats_sites( mybutton_url ) SELECT urlmybutton FROM ats_members
    may b this would help in snap’s case.
    Ny ways thanks for the post.. it helped me

  3. Oscar Says:

    It also helped to me, thanks 😉

  4. mando Says:

    thanks a lot! 😀

  5. ninad Says:

    got it Snap?
    🙂

  6. The Evil ONe Says:

    Man, I hate to say this, but thanks so much… I know it’s the simplest thing in the world, but I’m sure that (just like the rest of the coding public), after dealing with hours of complex joins/one type of psychotic hyper problem or whatever for most of the day, the syntax for things you once thought you knew… become googleable once again (kind of like zombies)… So, thanks!

  7. vijay Says:

    thanx a lot

  8. jacob Says:

    No words to explain 🙂 thank you so much.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: