Jump to content

how to insert data without overwrite old data in the same table


annaright

Recommended Posts

hi anyone here know how to insert data without overwrite the existing or current data in a table.

 

i have a table which is store a health information, this health information will change week by week, so i don't want to overwrite information and i want keep as a history info

 

Link to comment
Share on other sites

I don't understand the question -- just keep everything.

 

sorry maybe my question a bit confusing, its not INSERT but UPDATE....i want to update a table which is already have a data in the same time i don't want to overwrite the existing data. example;

 

Table person:

 

P_Id LastName FirstName Address City

1 John Mayer Street 1 London

2 Ray Caroline Street 2 Leeds

 

UPDATE Persons

SET Address='Street3', City='Manchester'

WHERE LastName='Ray' AND FirstName='Caroline'

 

The "Persons" table will now look like this:

 

P_Id LastName FirstName Address City

1 John Mayer Street 1 London

2 Ray Caroline Street 3 Manchester

 

but I still want to keep the previous data before the update as a history.

 

sorry my english really bad  :-[

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.