Re: How to count the result from sql statement?
From: David Harper (devnull_at_obliquity.u-net.com)
Date: 02/13/04
- Previous message: Jonathan Fisher: "Re: Create Access databases programmatically via JDBC-ODBC?"
- In reply to: kaiwing18_at_hotmail.com: "How to count the result from sql statement?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 13 Feb 2004 07:24:06 +0000
kaiwing18@hotmail.com wrote:
> I want to know how to count the result of sql from oracle9i.
> For example,
>
> "Select * from student where course_id='101'"
>
> if the result is two ppls, how can i retrieve this value
> form sql statement?
If you only want to know the number of matching rows, without having
to download all of the data, you should use the "count" function:
Select count(*) from student where course_id='101'
That way, you don't need to download 100,000 rows when all you want
to know is "There are 100,000 students on course 101".
David Harper
Cambridge, England
- Previous message: Jonathan Fisher: "Re: Create Access databases programmatically via JDBC-ODBC?"
- In reply to: kaiwing18_at_hotmail.com: "How to count the result from sql statement?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|