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!

How to get record where ROWNUM value is MAX

user2081225Sep 17 2010 — edited Sep 17 2010
Hi,

I am running below query and getting 2 rows. I want only one row where value of ROWNUM is maximum (i.e. 2 in this case). ROWNUM could be 3,4,5.... depend how much record retrived by below query but always I want that record where ROWNUM is maximum.

SQL> select sak_claim_adj daughter_claim, rownum
2 from t_adj_ub92_xref@link_to_prod
3 start with sak_claim = 177412524
4 connect by prior sak_claim_adj = sak_claim;

DAUGHTER_CLAIM ROWNUM
-------------- ----------
179610821 1
179611385 2

So Expected result should be
DAUGHTER_CLAIM ROWNUM
-------------- ----------
179611385 2


Thanks,
Rohit
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2010
Added on Sep 17 2010
3 comments
7,069 views