试试这个
SELECt @s:=@s+1 serial_number,student_id,student_name,student_avgFROM students, (SELECT @s:= 0) AS sWHERestudent_avg > 4;
https://stackoverflow.com/a/11096550/1423506

试试这个
SELECt @s:=@s+1 serial_number,student_id,student_name,student_avgFROM students, (SELECT @s:= 0) AS sWHERestudent_avg > 4;
https://stackoverflow.com/a/11096550/1423506