Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: help with sql statement
how about max?
select * from indexs where indate=max(indate);
or
for 2 most recent
select indate,indexs,volume from indexs i where indate=max(indate)
or indate=max((select indate from indexs i2 where i2.indate<i.indate ))
)
Also if you look in the documentation there are a bunch of analytical functions that might do it easier and better. I'm too lazy to look. Jim
"user" <utagi_at_yahoo.com> wrote in message
news:3dfade85$1_2_at_news.tm.net.my...
> does anybody know what is the sql statement to retrieve the last date in a
> table ?
> i need the statement to retrieve the volume of the last and 2nd last date
> and display them into a text box in my vb ....
>
> SQL> select * from indexs;
>
> INDATE INDEXS VOLUME
> --------- ---------- ----------
> 29-JUN-00 830.25 237
> 30-JUN-00 833.37 160
> 03-JUL-00 793.93 104
> 04-JUL-00 807.87 89
>
> thanks
>
>
Received on Sat Dec 14 2002 - 14:02:29 CST
![]() |
![]() |