Home » SQL & PL/SQL » SQL & PL/SQL » sql qurey
icon2.gif  sql qurey [message #210342] Wed, 20 December 2006 07:39 Go to next message
Messages: 25
Registered: September 2006
Junior Member
select * fro emp where rownum>5 this query d'not return any values.
select * from emp where rownum<5 this query return rows.

my question is why first query d'not return rows
Re: sql qurey [message #210344 is a reply to message #210342] Wed, 20 December 2006 07:50 Go to previous messageGo to next message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Rownum is a pseudocolumn assigned to each row that the query returns.
If you are always checking to see if there have been 5 other rows returned before you return a row, you won't get any back.
Re: sql qurey [message #210348 is a reply to message #210344] Wed, 20 December 2006 08:10 Go to previous message
Messages: 7062
Registered: December 2001
Senior Member
Look also here.

Previous Topic: redirecting result of a sql query in a file in shell scripting
Next Topic: Top 1
Goto Forum:

Current Time: Mon Oct 24 18:50:56 CDT 2016

Total time taken to generate the page: 0.12087 seconds