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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting the first matching record???

Re: Getting the first matching record???

From: Cisco <prsingh_at_cisco.com>
Date: 1997/04/09
Message-ID: <01bc4525$b03808a0$e0d044ab@prsingh-pc.cisco.com>#1/1

Hi
use
select a,b,c
from tab
where .....
and rownum = 1;

You can use hint first_rows to speed up the query.

Pratap

Michael Agbaglo <byteshif_at_cs.tu-berlin.de> wrote in article <01bc4535$4a6186e0$0200000a_at_pitfall>...
> SELECT COUNT(*), A, B
> FROM ...
> WHERE ...
> GROUP BY A, B
> HAVING COUNT(*) = 1
>
> Z. Martinez <zlm101_at_psu.edu> schrieb im Beitrag
> <334bd241.9605767_at_news.cac.psu.edu>...
> >
> > I have a large table (about 4 million rows) that I need to search
> > through. Although the query I'm using can result to multiple rows, I
> > only need the first matching row. This query will be executed probably
> > a hundred thousand times. So I really need to optimize it
> >
> > What is the most efficient way of getting the first matching record
> > PL/SQL? and Pro*C?
> >
> > Thanks in advance.
> >
> > Please send your response to zlm101_at_psu.edu
> >
> >
> >
>
Received on Wed Apr 09 1997 - 00:00:00 CDT

Original text of this message

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