Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: cursor definition query

Re: cursor definition query

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/07/21
Message-ID: <964216635.20885.0.pluto.d4ee154e@news.demon.nl>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US