Pittrap’s Weblog

Random stuff

MySQL copy one or more fields from one table into another table

Posted by Tim on March 20, 2008

If you’re trying to copy the data from some fields in one MySQL table into a different table you’d do it like so:

INSERT INTO TableOne (Username, Password, Email) (SELECT usern, passw, emailaddress FROM TableTwo)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>