Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL problem
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
-- Have a nice day Michel Johan Verlinden <jverlinden_at_connect.be> a écrit dans le message : 8smb0l$qmc$1_at_news1.skynet.be...Received on Thu Oct 19 2000 - 04:38:51 CDT
> 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
>
>