Aravind Rock Aravind Rock - 1 year ago 77
MySQL Question

Fetch Latest Entry In table. Last line in database table

I have a table


id value
__ _____
1 a
2 b
3 c
4 d
5 e

i want to fetch only latest entry in table (i.e) last value
=>id,value as 5,e

could you please tell me query for this.

Answer Source

use following select query

SELECT * FROM tablea where ID IN (SELECT MAX(ID) FROM tablea);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download