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
|
SELECT dbo.derniereminute.dm_datedep,
dbo.derniereminute.dm_iatad,
dbo.villedepart.v_libelle AS dm_iatadl,
dbo.derniereminute.dm_codeproduit,
dbo.produit_new.produit_code,
dbo.produit_new.produit_libelle,
dbo.produit_new.categorie_template,
dbo.produit_new.categorie_gamme,
CASE
WHEN dbo.produit_new.categorie_template = 'VOLSEC' THEN dbo.produit_new.categorie_type = "Billet d'avion"
ELSE dbo.produit_new.categorie_type = dbo.produit_new.categorie_type
END,
dbo.produit_new.categorie_type,
dbo.produit_new.destination_code,
dbo.produit_new.destination_libelle,
dbo.produit_new.destination_fils_code,
dbo.produit_new.destination_fils_libelle,
dbo.produit_new.produit_vignette,
dbo.derniereminute.dm_prix,
dbo.derniereminute.dm_actif,
dbo.derniereminute.dm_iataa
FROM dbo.produit_new RIGHT OUTER JOIN
dbo.produitvente ON dbo.produit_new.produit_code = dbo.produitvente.pv_codepere RIGHT OUTER JOIN
dbo.derniereminute ON dbo.produitvente.pv_codeproduit = dbo.derniereminute.dm_codeproduit LEFT OUTER JOIN
dbo.villedepart ON dbo.derniereminute.dm_iatad = dbo.villedepart.v_code
WHERE (dbo.produit_new.destination_type = dbo.produit_new.destination_basetype) AND (dbo.produit_new.destination_fils_type = 'pays') |
Partager