Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Row Count

Status
Not open for further replies.

hameja

Programmer
Oct 15, 2003
42
0
0
BE
Hi People

Is there any function in Oracle like Row count

 
Do you mean as in

select count(*) from <tablename>;

?

Alex
 
No I mean

select * from tbl where rowcount </> number
 
Hameja,

You can say:
Code:
select * from tbl where [b]rownum <=[/b] <some number>;
...but due to the nature of the ROWNUM expression, you cannot make comparisons (using the above syntax) with the ">" comparison operator and achieve the results you want. So, in summary, always use "<" or "<=" for your ROWNUM comparison operator.

(There are tricks to use "=", ">=", and ">" with ROWNUM, but that is a topic we'll address if you ask for it.)

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top