ungefär so?
Wenn ich Sie richtig verstanden habe.Code:with a as (select item, max(dat) as dat from VKfile group by item), b as (select item, dat, price from a, VKfile where a.item=VKfile.item and a.dat=VKfile.dat), c as (select item, max(dat) as dat from EKfile group by item), d as (select item, dat, price from a, EKfile where a.item=EKfile.item and a.dat=EKfile.dat) select item, b.price als VKP, d.price as EKP from b, d where b.item = d.item
in B und D steht je Item der letzte Wert. Nur wenn Preise im voraus erfasst werden sind noch Anpassungen nötig.
DiBe
![[NEWSboard IBMi Forum]](images/duke/nblogo.gif)



Mit Zitat antworten
Bookmarks