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

 

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  :-[

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.