List:MySQL on Win32« Previous MessageNext Message »
From:Jani Tolonen Date:August 31 1999 7:50am
Subject:Getting Data from one table to another
View as plain text  
John Corbin writes:
 > I have a table which I want to contain the most currrent data on my users. I
 > have a history table which I would like to move the current data to when
 > there is a change so that I have an audit trail/history of changes to each
 > user. So how do i get the data in the users table to the histroy table when
 > I need to update the users table. Both tables have the same data items.
 > 
 > 
 > John
 > jcorbin@stripped
 > 

Hello John,

Use mysql> INSERT INTO history SELECT * FROM users;

See also LOCK TABLES -syntax.

Regards,

- Jani

-- 
+-------------------------------------------------------------+
| TcX  ____  __     _____   _____  ___                        |
|     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|       Jani Tolonen     |
|    /*/ /*/ /*/   \*\_   |*|   |*||*|       jani@stripped   |
|   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|       Helsinki         |
|  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|_____  Finland          |
|  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                   |
|             /*/             \*\            Developers Team  |
+-------------------------------------------------------------+
Thread
I need your help. Can anybody help me to run MySQL under Windows95?D.B.N.28 Aug
Re: I need your help. Can anybody help me to run MySQL under Windows 95?Vladimir N. Goida28 Aug
  • Re: I need your help. Can anybody help me to run MySQL under Windows 95?Aaron Johnson28 Aug
  • Re: I need your help. Can anybody help me to run MySQL under Windows 95?Simson L. Garfinkel28 Aug
  • Getting Data from one table to anotherJohn Corbin28 Aug
    • Getting Data from one table to anotherJani Tolonen31 Aug