There is three field in my data base id(primary key),name, salary I want fetch top 3 salary from the database.
Asked
Active
Viewed 4,362 times
4 Answers
1
SELECT [column(s)]
FROM [table]
ORDER BY [column(s)] [ASC, DESC];
For more information check here: http://www.sqlite.org/lang_select.html

Neil Knight
- 47,437
- 25
- 129
- 188
1
Use LIMIT to get top 3 after ordering, as such:
SELECT *
FROM myTable
ORDER BY salary DESC
LIMIT 3;

Stefaan Carbon
- 156
- 5