Hi,
This request with the sign ( + ) is giving me an error ORA-00936: missing expression. How to solve that ?
with
r as (
select trunc(t.date_travaux, 'yyyy') date_travaux, sum(t.montant_facture) montant_facture from mv_entretien t
where vehicule = 1 and TYPE_TRAVAUX <> 4
GROUP by trunc(t.date_travaux, 'yyyy')),
y as (select date1,cout_carburant from mv_cout_carburant where vehicule = 1)
select trunc(a.date_kilometrage, 'yyyy') "Année", a.kilometrage "Kilométrage", ((b.cout_acquisition/6)+r.montant_facture+y.cout_carburant)/a.kilometrage "Prix de revient km"
from mv_kilometrage a, mv_amortissement b, r, y
where trunc(r.date_travaux, 'yyyy') = trunc(a.date_kilometrage, 'yyyy') (+)
and trunc(y.date1, 'yyyy') = trunc(a.date_kilometrage, 'yyyy')
and a.vehicule=1
order by a.date_kilometrage;
Thank you for your kind help.
Best regards.