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 |
+-------------------------------------------------------------+