Moving Data from one column to another similar column in another table MYSQL
mysql
Solution
If you simply wanted to insert the data into new records within the `revenue` table:
INSERT INTO revenue (receiptno) SELECT receiptno FROM clients;
However, if you want to update existing records in the `revenue` table with the associated data from the `clients` table, you would have to join the tables and perform an `UPDATE`:
UPDATE revenue JOIN clients ON **join_condition_here**
SET revenue.receiptno = clients.receiptno;
Learn about SQL joins.
Problem
I am currently working on a webbased systen using a Mysql db. I realised that I had initially set up the columns within the tables incorrectly and I now need to move the data from one table column (receiptno) in table (clients) into a similar table column(receiptno) in table (revenue). I am still quite inexperienced with Mysql and therefore I dont know the the mysql syntax to accomplish this. Can I get some help on it. Thanks