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 -> Reducing hte number of SQL statements

Reducing hte number of SQL statements

From: Senthil Kumar <skumar_at_scotch.cs.mci.com>
Date: Fri, 05 Jun 1998 02:50:50 GMT
Message-Id: <slrn46nen8r.hat.skumar@scotch.mcit.com>


Assume there is some table T.
For some select criteria, I only want
the first 10 rows, however, I also want to find out the number of rows that match the select criteria.

Is it possible to do this in one
SQL statement?

I know how to do this in 2 SQL statements.

  1. select count(*) from T where ...
  2. select ... from T where .. AND rownum <= 10

thanks,
Senthil Received on Thu Jun 04 1998 - 21:50:50 CDT

Original text of this message

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