SQL Select Last

SQL Select First is used to return last value of selected column.

Take Table name Student

ID Name Age City
1 Rahul 20 Pathankot
2 Karan 24 Mohali
3 Ajay 22 Pathankot
4 Ravi 23 Delhi


Syntax

SELECT LAST(column_name) FROM table_name;  



SELECT LAST(`Name`)  FROM Student;  



Output

LAST(`Name`) Ravi

Back To Top