Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Select top row in Single Query?

Raghav.786Sep 19 2013 — edited Sep 19 2013

Hi

Can somebody help me to write a query to get the first row after order by clause using single query alone.
Example:
I can write following query to select first row
select * from (selec * from t order by col1) where rownum = 1;

But here I should not use inline view to get the result. Because my original requirement needs to use this query in select list and it needs to use a column (of a table from the FROM clause) in the where clause of inline query. Because there is restriction that we can not use the column (of a table from the FROM clause) more than one level of inline query.

Please help me.

This post has been answered by Raghav.786 on Sep 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2013
Added on Sep 19 2013
6 comments
3,464 views