aspose file tools*
The moose likes JDBC and the fly likes Explain working of Rownum Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Explain working of Rownum" Watch "Explain working of Rownum" New topic
Author

Explain working of Rownum

Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 246

This is the table account having two columns name and salary

name salary
A 1000
B 1500
C 1300
D 1200
E 1400
F 1100



ROWNUM NAME SALARY
---------------------------------------
1 B 1500
2 E 1400
3 C 1300
This query returns the Highest three salaries

But when I just want to retrieve top most salary It says No Rows Selected what that means



Oracle Java Programmer , Oracle SQL Expert , Oracle Java Web Component Developer
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Is it Oracle? I cannot reproduce the issue, I'm getting one row with the rownum = 1 condition.
Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 246

Yes it is Oracle
When I try this in the browser it works as expected but It says "No rows selected" when I use SQL*PLUS command line.

I have SQL* plus release 10.2.0.

Thank you for your time
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Explain working of Rownum