Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Getting Record Count from SELECTs

Re: Getting Record Count from SELECTs

From: HansF <News.Hans_at_telus.net>
Date: Tue, 11 Oct 2005 16:13:59 GMT
Message-Id: <pan.2005.10.11.16.12.41.62856@telus.net>


On Tue, 11 Oct 2005 08:45:41 -0700, GeoPappas interested us by writing:

> Is there any way to get the record count from a SELECT statement
> without having to run another query?
>
> For example, say you have a query as follows:
>
> SELECT * FROM temp WHERE create_date < TO_DATE( '01/01/2005',
> 'MM/DD/RRRR' );
>
> Is there any way to get the record count without having to run anothe
> SELECT, such as:
>
> SELECT COUNT(*) FROM temp WHERE create_date < TO_DATE( '01/01/2005',
> 'MM/DD/RRRR' );
When, exactly, do you want the count value? Do you need it before the 'select *' (for example, to control a loop), during, or at the end (to indicate how many have been received)?

Which environment are you using? (Pro*C, SQL*Plus, VB/.Net)

-- 
Hans Forbrich                           
Canada-wide Oracle training and consulting
mailto: Fuzzy.GreyBeard_at_gmail.com   
*** I no longer assist with top-posted newsgroup queries ***
Received on Tue Oct 11 2005 - 11:13:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US