In the example below we want to update 29th March data based on 30th March.
Before Update:
After Update:
SQL:
update Table1 set Col1 = B.Col1, Col2 = B.Col2, Col3 = B.Col3 from Table1 A join ( select ID, Col1, Col2, Col3 from Table1 where Date = 20110330 ) B on A.ID = B.ID and A.Date = 20110329 where A.Date = 20110329
Leave a Reply