Monthly Archives: February 2018

How to Get Last Row From mysql

Hi Friends,
How to find out the last row data from database. It’s very useful to developers. Suppose our table has different field and multiple row values exist. We find the last values from database for some purpose like find the last row values id or something like this.

Syntax

Select * from table name order by id desc limit 1;

eg:

SELECT * FROM student_master ORDER BY student_id DESC LIMIT 1

From the above code we get the last row values from student_master table in mysql.