I'm trying to to fetch score from previous rank belonging to another student for every row in the following select statement. Now, I'd like to have the Score of previous Rank in each GroupCode for every CourseCode and StudentCode.
SELECT StudentCode, CourseCode,GroupCode, Score, StudentRank
FROM Table
my table data

You can use
apply:However, same could also achieve with correlation approach :