If you want to find the top 5 tallest guys in a class, how do you do it?
1. First, sort them up by lining them from the tallest to the shortest (or vice versa);
2. Next, start to count and select the first 5 guys in front.
Do the same in SQL,
A. Use
ORDER BY[
^] to sort the table by the field of interest, e.g. salary.
B. Next, find out how to get the top 5 rows by checking out
SQL SELECT TOP, LIMIT, ROWNUM[
^], there are different versions.
Putting A and B in one SQL statement and that will be the answer you are looking for.