I’m sure this has been answered before, but the thing is I don’t know how to look for the solution.
I have a Oracle query that gives me this results:
ETA Vessel Line POD SZTP QTY
==== ====== ==== === ==== ===
26/12 MAEWIS MAE LIV 40RH 23
26/12 MAEWIS MAE PBL 40RH 12
26/12 APLMEN APL PTR 20DR 44
26/12 APLMEN APL TRU 20DR 22
27/12 APLMEN APL ECS 40RH 7
27/12 RICKEM HPL RTT 40RH 18
And what I need is this:
ETA Vessel Line POD SZTP QTY
==== ====== ==== === ==== ===
26/12 MAEWIS MAE LIV 40RH 23
PBL 40RH 12
APLMEN APL PTR 20DR 44
TRU 20DR 22
27/12 APLMEN APL ECS 40RH 7
RICKEM HPL RTT 40RH 18
Maybe also doing it for POD and SZTP, if there are many of those within ETA/VSL/LINE
Is there any way of doing this?
This is my query:
select to_char(vv.eta, 'DY-DD/MM') eta,
a.linevv_vv_vsl_id||'/'||vv.out_voy_nbr vessel,
a.linevv_line_id line,
a.discharge_port_id1 pod,
b.sztp_id sztp,
b.qty qty
from
service_orders a,
service_order_items b,
vessel_visits vv
where
b.so_gkey = a.gkey and
vv.vsl_id = a.linevv_vv_vsl_id and
vv.out_voy_nbr = a.linevv_vv_out_voy_nbr and
sub_type = 'VEPO' and
((vv.eta between sysdate and sysdate + 7) or (to_char(vv.ata, 'YYYY-MM-DD') = to_char(sysdate, 'YYYY-MM-DD')))
order by to_char(vv.eta, 'YYYY-MM-DD')
I’m using Pentaho ETL Tool Kettle to run the query, and transform the data stream into an XML. So, if the solution is on the ETL, I could use some help on how to do it there too.
Many thanks for your help.
I much prefer having all rows defined correctly with all the keys. However, you can do this, you just need to identify the first rows of each grouping.