I'm not good at SQL, but it's hard for me to figure out how to do this.
I have a table called testwith a column of characters with a name keyand two columns datetimecalled TestTimeand LastTestTime.
I am trying to write a query that updates all rows and sets the value LastTestTimefor the last previous TestTimefor the same key.
Here is an example of how I want this to work out:
key testTime lastTestTime
------------------------------
aaa 1/1/2012 null
aaa 1/2/2012 1/1/2012
aaa 1/3/2012 1/2/2012
Dan b source
share