File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "Explain working of Rownum" Watch "Explain working of Rownum" New topic

Explain working of Rownum

Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 371

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

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

Joined: Aug 22, 2010
Posts: 3728

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: 371

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:
subject: Explain working of Rownum
It's not a secret anymore!