I only want the SELECT DISTINCT statement on 'yearLevel' (as I don't want any duplicates only on yearLevel)
image of data displayed on screen
For example I only want one 'yearLevel' 12 record in the table, and for that to be the one with the lowest 'totalSeconds'
code
$sql = "SELECT firstName, lastName, yearLevel, totalSeconds
FROM studentInformation
JOIN record
ON studentInformation.studentId = record.student_Id
ORDER BY totalSeconds ASC
LIMIT 1 ";
Is it possible to do this -
$sql = "SELECT firstName, lastName, DISTINCT yearLevel, totalSeconds
FROM studentInformation
JOIN record
ON studentInformation.studentId = record.student_Id
ORDER BY totalSeconds ASC
LIMIT 1 ";