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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL riddle !

Re: SQL riddle !

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 7 Apr 2000 20:01:44 +0200
Message-ID: <955131099.13019.1.pluto.d4ee154e@news.demon.nl>


select num_project, num_contact
from contacts c1
where date_cre =
(select min(date_cre)
 from contacts c2
 where c2.num_project = c1.num_project)

Hth,

Sybrand Bakker, Oracle DBA

  "olivier ALLAIN" <oallain_at_celya.fr> wrote in message = news:38EE161D.62FF2B51_at_celya.fr...
  I have a table which looks like this :   NUM_CONTACT DATE_CRE NUM_PROJECT

  and i want to know the num_contact of the oldest contact of each = project.

  Of course, i can't do that :

      select min(date_cre),num_contact from contacts group by = num_project;

  Is thereanyone who can help me ?

  Thanx

  Oli ALLAIN Received on Fri Apr 07 2000 - 13:01:44 CDT

Original text of this message

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