Q:

How to get 2 maximum id from table in mysql

I have many records in my table.I want to fetch 2 records which should have maximum or second last maximum id value .How will i do this in mysql?

A:

SELECT FROM [table] WHERE [condition] ORDER BY `id` DESC LIMIT 2

