Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to return just one row after finding it
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
![]() |
![]() |