Hello list,

After searching the documentation on the site, as well as the archives, I
have yet to find the answer to this question. If I have overlooked it
somewhere, just point me in the right direction.

The question:

I have two tables, set up exactly the same, except the names of the tables
are different.

Table 1 is called: active_users
Table 2 is called: deleted_users

When "joe_smith" wishes to be deleted, I want to remove his entry from the
active_users table, and place it into the delete_users table, with exactly
the same information.

Something like: replicate * from active_users where user_name = "joe_smith"
into table deleted_users;

All entries in Table 1 are unique by user_name (joe_smith in this case),
but such is not the case in the deleted_users (there is more than one
joe_smith in the world, if one cancels, we need to allow another one to
signup), which is why I can't just add an extra column to tell if the user
is active or not.

I could do a select from active_users, store the information, then insert
into deleted_users, then delete from active_users, but that is three steps
when it seems there should be an easier (more efficient) way.


Any ideas or links to archives or documentation is appreciated.




=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Aaron Williams   [EMAIL PROTECTED]
Dev. Engineering  StarNet Incorporated
WholeSale Dial-Up    www.megapop.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to