This question already has an answer here:
- PostgreSQL, SELECT from max id 5 answers
I have a table in database which has a primary key called id. Now i want to display the most recently added 2 records into the table.
</div>
This question already has an answer here:
I have a table in database which has a primary key called id. Now i want to display the most recently added 2 records into the table.
</div>
This wil definitely work,
SELECT * FROM table_name ORDER BY id DESC,LIMIT 2.