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: SQL problem

Re: SQL problem

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Thu, 19 Oct 2000 11:38:51 +0200
Message-ID: <8smfh2$2f1$1@s1.read.news.oleane.net>

Could be something like:

select a.tank,a.phase,a.date,a.stock
from e_workord a,

     (select tank, phase, min(date) min_date
      from e_workord group by tank, phase) b
where a.date = b.min_date

  and a.phase = b.phase
  and a.tank = b.tank
order by a.tank, a.phase
--
Have a nice day
Michel


Johan Verlinden <jverlinden_at_connect.be> a écrit dans le message : 8smb0l$qmc$1_at_news1.skynet.be...

> I'd like to adapt the following select-statement so I keep just the first
> row after each break on tank/phase
>
> select tank,phase,stock from e_workord order by tank,phase,date desc,workord
>
> The table e_workord has the following fields :
> workord,phase,date,tank,stock.
> Can this be done with just SQL (by means of correlated subqueries)?
>
> Thanks,
>
> Johan Verlinden
>
>
Received on Thu Oct 19 2000 - 04:38:51 CDT

Original text of this message

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