Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
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.7k points)

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

Query:

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)

Browse Categories

...