Reputation: 659
What is the correct SQL statement if i wish to select the biggest 5 integer rows in the column "id"?
Currently i have something which is only getting id that are less than 5:
SELECT * FROM table WHERE id < 5
Upvotes: 1
Views: 1941
Reputation: 5433
If I understand you correctly , i think you need this,
SELECT * FROM table ORDER BY id DESC LIMIT 5
Upvotes: 1