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
sridharbireddy
Messages: 25
Registered: September 2006
Junior Member
select * fro emp where rownum>5 this query d'not return any values.
but
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
JRowbottom
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
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Look also here.

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


Current Time: Fri Apr 26 12:31:19 CDT 2024