As Sandya pointed out there is no TOP function in Oracle(atleast till version 9i)..
So you can either use a rank() function or use rownum.
And one clarification ...
Use rank() over(order by column desc) for top 10 rows and
rank() over(order by column) for bottom 10 rows...
And if you have contention between two or more rows and you want all of these rows to be displayed , then use Dense_rank() function. For example if you have four people with salaries like this:
NAME SALARY
A 1000
B 2000
C 3000
D 3000
Now using rank() to get top 3 rows will return
D 3000
C 3000
B 2000
whereas using dense_rank() will return all rows
D 3000
C 3000
B 2000
A 1000
Comment