Hi
I have a SQL Server 2005 database with a list of results for a variety of people over time. i would like to be able to look at any row and from that row know the last 3 results for that person
the columns are like this
date ----- person ----- result
i would like to be able to add in columns which would show
----- last result ----- last but one result ----- last but two result
i could then look at averages etc so my table (or new table) would be
date ----- person ----- result ----- last result ----- last but one result ----- last but two result
Can anyone help with a way to do this? it would need to find the previous record of the person and get their result and then go to the record of that person before that and get the result etc etc.
thanks in advance and merry christmas.
I have a SQL Server 2005 database with a list of results for a variety of people over time. i would like to be able to look at any row and from that row know the last 3 results for that person
the columns are like this
date ----- person ----- result
i would like to be able to add in columns which would show
----- last result ----- last but one result ----- last but two result
i could then look at averages etc so my table (or new table) would be
date ----- person ----- result ----- last result ----- last but one result ----- last but two result
Can anyone help with a way to do this? it would need to find the previous record of the person and get their result and then go to the record of that person before that and get the result etc etc.
thanks in advance and merry christmas.
Comment