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: Newbie question: SQL*Plus command to see number of query result rows

Re: Newbie question: SQL*Plus command to see number of query result rows

From: Terry Dykstra <dontreply_tddykstra_at_forestoil.ca.x>
Date: Thu, 18 Mar 2004 15:33:12 GMT
Message-ID: <Yij6c.200670$A12.131215@edtnps84>


You could always use
select count(*) from (your original select)

-- 
Terry Dykstra
Canadian Forest Oil Ltd.
"syandoa" <junkmale_at_carolina.rr.com> wrote in message
news:4058AF04.5040208_at_carolina.rr.com...

> Lara wrote:
> > Hi, I have what I think is a simple SQL*Plus question, but I can't
> > find the answer in any of my books.
> >
> > I'm trying to turn off SQL*Plus displaying the result of each row in a
> > select statement, and just want to see the number of rows the select
> > statement would generate. I'm trying to see if my select statement is
> > correctly generating the correct number of rows. I know it should
> > generate 154,280 rows, but it takes too long to sit here and wait to
> > see the results if every row of the query result displays.
> >
> > In other words (in a shortened example), I currently have:
> >
> > SQL> Select student_id from student;
> >
> > STUDENT_ID
> > ----------
> > 391
> > 392
> > 393
> > 3 rows selected.
> >
> >
> > Is there any command I can use to get:
> > SQL> Select student_id from student;
> >
> > 3 rows selected.
> >
> >
> > p.s. I don't think I can use COUNT because there are multiple joins
> > and subqueries throughout the select.
> >
> > Thanks!
>
> Can you run the results into a temp table and do a count(*) from the
> temp table?
>
Received on Thu Mar 18 2004 - 09:33:12 CST

Original text of this message

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