Re: select MAX and get the recode??
Posted in 1996
ccliu wrote:
>
> Hi net,
> How can I select the max value and get the whole record?
>
> item_num order_num price customer Date
> -------------------------------------------------------------------
> 1 100 $198 David 1996/1/1
> 1 101 $187 Scott 1996/2/1
> 1 103 $887 Lana 1996/3/1
> 2 101 $776 Lee 1996/6/2
>
> Select max(order_num) from items where item_num = 1;
>
> can get order_num=103, BUT, how can I also get the ("$887", "Lana", "1996/3/1")
> ???
>
> Jack
Something like;
select * from items
where order_num =
(select max(order_num) from items)
should work OK.
Bryan Tonnet
batonnet@zeta.org.au