Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in SQL by (20.3k points)

How do I do the following?

select top 1 Fname from MyTbl

In Oracle 11g?

1 Answer

0 votes
by (40.4k points)

You can try the below query if you want to use the first selected row.


select fname from MyTbl where rownum = 1

To order and take the top x, You can use analytic functions like this:

select max(fname) over (rank() order by some_factor) from MyTbl

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 22, 2019 in SQL by Tech4ever (20.3k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.1k users

Browse Categories