So far I have this code:
Code:
SELECT e.employee_number,
MAX(a.appraisal_date) AS 'appraisal_date',
a.appraisal_type
FROM pwa_master.appraise a
INNER JOIN pwa_master.people e
ON e.unique_identifier = a.parent_identifier
GROUP BY e.employee_number
Which returns the below (example):
The row I want to remove is highlighted
00218 2006-02-06 00:00:00.000 V1
00218 2002-10-31 00:00:00.000 V2
00282 2006-02-06 00:00:00.000 V2
00330 2004-10-31 00:00:00.000 V1
Basically I only want to return:
00218 2006-02-06 00:00:00.000 V1
00282 2006-02-06 00:00:00.000 V2
00330 2004-10-31 00:00:00.000 V1
Is there anyway I can only pick out the top record based on appraisal_date?
Cheers in advance
- GeorgeV