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

Home -> Community -> Usenet -> c.d.o.server -> Re: how to do this with sql?

Re: how to do this with sql?

From: <chris.hulan_at_gmail.com>
Date: 10 May 2006 08:17:40 -0700
Message-ID: <1147274260.314719.16400@i39g2000cwa.googlegroups.com>


select name, surname, n2.customer_id
from (select name, customer_id

      from table_a
      where name is not null
      and entry_date = (select max(entry_date)
                       from  table_a ta2
                       where ta2.name is not null
                       and ta2.customer_id =  table_a.customer_id) ) as
n1,
     (select surname, customer_id
     from table_a
     where surname is not null
     and entry_date = (select max(entry_date)
                      from  table_a ta2
                      where ta2.surname is not null
                      and ta2.customer_id =  table_a.customer_id) ) as
n2
where n1.customer_id = n2.customer_id;

Just off the top of my head so may need debugging... Received on Wed May 10 2006 - 10:17:40 CDT

Original text of this message

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