Попробуйте это:
CREATE TABLE #DataSource
(
[username] VARCHAR(16)
,[date] DATE
,[value] VARCHAR(16)
,[IDexam] VARCHAR(16)
,[No.Points] TINYINT
);
INSERT INTO #DataSource ([username], [date], [value], [IDexam], [No.Points])
VALUES ('brad', '1/2/2010', 'not pass', 'exam1', 10)
,('brad', '2/2/2010', 'pass', 'exam1', 15)
,('brad', '1/3/2010', 'pass', 'exam2', 20)
,('brad', '1/3/2010', 'not pass', 'exam3', 12)
,('fred', '1/3/2010', 'pass', 'exam2', 25)
,('fred', '5/3/2010', 'pass', 'exam2', 20)
,('fred', '5/4/2010', 'not pass', 'exam3', 12);
SELECT [username]
,MAX(IIF([IDexam] = 'exam1', [date], NULL)) AS [Exam1-value]
,MAX(IIF([IDexam] = 'exam1', [value], NULL)) AS [Exam1-date]
,MAX(IIF([IDexam] = 'exam1', [No.Points], NULL)) AS [Exam1-points]
,MAX(IIF([IDexam] = 'exam2', [date], NULL)) AS [Exam2-value]
,MAX(IIF([IDexam] = 'exam2', [value], NULL)) AS [Exam2-date]
,MAX(IIF([IDexam] = 'exam2', [No.Points], NULL)) AS [Exam2-points]
,MAX(IIF([IDexam] = 'exam3', [date], NULL)) AS [Exam3-value]
,MAX(IIF([IDexam] = 'exam3', [value], NULL)) AS [Exam3-date]
,MAX(IIF([IDexam] = 'exam3', [No.Points], NULL)) AS [Exam3-points]
,MAX(IIF([IDexam] = 'exam4', [date], NULL)) AS [Exam4-value]
,MAX(IIF([IDexam] = 'exam4', [value], NULL)) AS [Exam4-date]
,MAX(IIF([IDexam] = 'exam4', [No.Points], NULL)) AS [Exam4-points]
,MAX(IIF([IDexam] = 'exam5', [date], NULL)) AS [Exam5-value]
,MAX(IIF([IDexam] = 'exam5', [value], NULL)) AS [Exam5-date]
,MAX(IIF([IDexam] = 'exam5', [No.Points], NULL)) AS [Exam5-points]
FROM
(
SELECT *
,ROW_NUMBER() OVER (PARTITION BY [username], [IDexam] ORDER BY [date] DESC) AS [RowID]
FROM #DataSource
) DS
WHERE [RowID] = 1
GROUP BY [username]
DROP TABLE #DataSource;