I am querying data from two tables (students2014 and notes2014) in order to return a list of students along with notes on each student. To do this I am using the following select statement:
SELECT *
FROM students2014
LEFT JOIN notes2014
ON students2014.Student = notes2014.NoteStudent
WHERE students2014.Consultant='$Consultant'
ORDER BY students2014.LastName
This successfully gives me a list, however students with more than one note appear twice, for e.g:
- Student a - Note
- Student a - Note
- Student b - Note
- Student c - Note
etc...
I only want the latest note to appear for each student, thus delivering a list of each student only once.
Hope that makes sense?