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: How to return just one row after finding it

Re: How to return just one row after finding it

From: Mark G <mgumbs_at_hotmail.com>
Date: Mon, 4 Oct 1999 10:26:11 +0100
Message-ID: <37f8700c.0@145.227.194.253>


The second query will return the first row which matches the criteria. It will not search all rows first.
The first would be the quickest if indexes were used.

M

Ted Knijff <knijff_at_bigfoot.com> wrote in message news:37F51126.700D7ADE_at_bigfoot.com...
> I think this will still search all PartDate entries and return only one.
> You are best of with an index on PartNo and PartDate and then your first
> option will be fastest.
> The second option will search all PartDate entries and return one always.
>
> Ted
>
> > I think
> >
> > select Max(PartDate)
> > from PartHistory
> > where PartNumber=1000
> >
> > is a possibility finding one record using standard SQL
> >
> > select PartDate
> > from PartHistory
> > where PartNumber=1000 and RowNum=1
> >
> > is another way using ORACLE specific SQL
>
Received on Mon Oct 04 1999 - 04:26:11 CDT

Original text of this message

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