Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Select max
select * from foo where bfield =
(select max(bfield) from foo)
"Leonardo Lombardo" <leo.lombardo_at_inwind.it> wrote in message
news:92a335d0e9cd9712defc44fee77a039c.69477_at_mygate.mailgate.org...
> Hi all,
>
> my question/problem is:
>
> I want to select a row from a table where one of its field has the
> maximum value in that table. For example:
>
> Table FOO
> id number
> afield varchar2
> bfield date
>
> How can I write an sql statement that selects the whole row in which
> bfield is max ?
>
> Thanks in advance, Leonardo
>
>
> --
> Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Mon Jul 22 2002 - 07:14:14 CDT