Cela renverra le rang, l'ID étudiant et le GPA des étudiants.
set @rownum := 0;
SELECT @rownum := @rownum + 1 AS rank, student_id, gpa
FROM `students` ORDER BY gpa DESC
Cela renverra le rang, l'ID étudiant et le GPA des étudiants.
set @rownum := 0;
SELECT @rownum := @rownum + 1 AS rank, student_id, gpa
FROM `students` ORDER BY gpa DESC