Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: cursor definition query
select customer_id
, visit_date
from table t
where visit_date =
(select max(visit_date) from table t1 where t1.customer_id = t.customer_id )
Hth,
Sybrand Bakker, Oracle DBA
"Ken Ho" <hoke_at_gse.harvard.edu> wrote in message
news:39789f5f.19486749_at_news.harvard.edu...
> If I have a table whose columns are:
>
> customer_ID varchar2(4)
> visit_date date
>
> and each customer has 1 or more visits, how would I select a single
> row for each customer_ID, with the stipulation that I must have the
> row with the most recent visit_date value?
Received on Fri Jul 21 2000 - 00:00:00 CDT
![]() |
![]() |