Is there any shortcut to automatically duplicate a row into the same table?
The only catch is that my PK is autoincrementing and I want to duplicate one row as a new row.
Thanks!
-- Abe --
Duplicating Rows
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Not so much a benefit, just an easier way to manage my data.Everah wrote:If you don't mind me asking, what is the benefit to having duplicate data (less the PK) in a table?
I'm in the finishing stages of building a full-on classified system for my university.
One of the parts is like a control panel, where users can view their currently running ads and previous ads. My system allows them to repost or delete ads with one click.
Because we want to keep a complete record of all ads being posted (not trying to be "big-brother", just CYA), when ads are deleted, we simply "deactivate" them versus actually deleting them.
So, when a user wants to repost their ad, we set the current ad to inactive, and repost the very same ad under a new row with the same exact information, just a different PK.
Does this make sense?
-- Abe --
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA