I used
select * from equation_table order by type desc limit 1
But it returns 2nd record from the table.
I used
select * from equation_table order by type desc limit 1
But it returns 2nd record from the table.
If you have an autoincrement id in your table which is names as id. then you can simply run below SQL to get last inserted record.
SELECT * FROM TABLE_NAME WHERE id != 0 ORDER BY id DESC LIMIT 0,1
try this :
SELECT *
FROM equation_table
WHERE Eqtbl_id != 0
ORDER BY Eqtbl_id DESC
LIMIT 1
You can find more by this answer
if id is primary and autoincreament field then.
Select * from equation_table ORDER BY id DESC LIMIT 1;