This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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
Author

Explain working of Rownum

Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 354

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



http://www.mahtabalam.net , Oracle Java Programmer , Oracle SQL Expert , Oracle Java Web Component Developer
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3718
    
  61

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

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Explain working of Rownum
 
jQuery in Action, 3rd edition