1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| SELECT T1.phase
, T1.organisation
, T1.année
, T1.mois
, T2.[type flux]
, T2.[type routage]
, T2.routage
, T2.[zone cédante]
, T2.[zone prenante]
, T2.marché
, T1.pays
, T2.canal
, T2.circuit
, T1.[niveau article]
, T1.article
, T2.région
, T1.[niveau article regroupement]
, T1.[article regroupement]
, T1.volume
, [volume]*[nouveau ratio] AS résultat
, [volume palettes]*[nouveau ratio] AS [résultat palettes]
, [volume litres]*[nouveau ratio] AS [résultat litres]
FROM T1 LEFT JOIN T2
ON (T1.pays = T2.pays)
AND (T1.phase = T2.phase)
AND (T1.organisation = T2.organisation)
AND (T1.année = T2.année)
AND (T1.mois = T2.mois)
AND (T1.marché = T2.marché)
AND (T1.canal = T2.canal)
AND (T1.circuit = T2.circuit)
AND (T1.[groupe marques] = T2.[groupe marques])
WHERE (((T2.[type routage])="TRANSFERT")
AND ((T2.routage) Like "TRANSFERT*"))
OR (((T2.[type routage])="LIVRAISON")
AND ((T2.routage) Not Like "TRANSFERT*"))
; |
Partager