Reply
Old 06-23-2014, 10:06 PM   #1 (permalink)
 
Status: Senior Member
Posts: 1,217



Default mysql - moving a record from one table to another

I am trying to move a record in my 1st table, "catalog_table" to my second table, "finalcatalogproduct". What is the query needed to move an individual record from table to another?

I want to pull the record from one column in the first table and place into a column into the second table. Is this possible? Or do I have to manually change the data in the table? The original files are in CSV format by the way. Help is appreciated.

Nick is offline   Reply With Quote
Old 06-23-2014, 10:06 PM   #2 (permalink)
 
Status: Junior Member
Posts: 7



Default mysql - moving a record from one table to another

For safety helping on your DB data, you'd better to create new table or and with a new database first, let's the data exactly copy / settle to the second place before you do any delete. Also, you have to export the original table SQL file to your PC, in case for security if you got any trouble on it and then you could put it restore back up.
Highly recommend to watch this video tutorial - "How to convert data in safe?"
you can start from 2:05 but watch through whole video would be much better for you.
http://youtu.be/GBIPvivQMDI
HellBuddyWebDeveloper is offline   Reply With Quote
more..
Old 06-23-2014, 10:06 PM   #3 (permalink)
 
Status: Senior Member
Posts: 2,787



Default mysql - moving a record from one table to another

>>> "I want to pull the record from one column in the first table and place into a column into the second table."

As you described it, that is NOT possible.

In order to pull the record from one column, the record would have to exist in that one column, but columns do NOT contain records.

To move a record from one table to another you first copy the record to the second table and then delete it from the first table.

You would do the copy with an INSERT ... SELECT
http://dev.mysql.com/doc/refman/5.1/en/insert-select.html
EddieJ is offline   Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to MOVE selected record from one table to another when users delete record? Awesome90 Databases 0 01-07-2014 07:06 AM
JDBC with MySQL:How the undergiven table be generated thru while loop in java together with MySQL table? JavedA MySQL Databases 0 07-21-2012 02:36 PM
In Access 2010, how do I copy the primary key on my main table for the current record, over to another table? Unknown_User Databases 1 04-27-2012 10:37 AM
Inserting a selected record from a table into different table using inbuilt select button from gridview? Unknown_User Coding 0 01-16-2012 05:36 AM
how to update a table in oracle by using values of next record into current record Gizakase Coding 1 06-23-2011 04:38 PM