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
|
SELECT
ent_contrat.contrat AS contrat,
ent_contrat.date_debut AS date_debut,
ent_contrat.date_fin AS date_fin,
ent_voyage.IDcontrat AS IDcontrat,
portL.nom AS pol,
portD.nom AS pod,
MAX(CASE WHEN P.idTypeClasse = 1 THEN P.prix) as prix1,
MAX(CASE WHEN P.idTypeClasse = 2 THEN P.prix) as prix2
FROM
ent_voyage,
ent_voyage_type_classe P,
ent_contrat,
ent_port portDe,
ent_port portA
WHERE
ent_voyage.IDvoyage = prixA.IDvoyage
AND ent_voyage.IDvoyage = prixB.IDvoyage
AND ent_voyage.IDcontrat = ent_contrat.IDcontrat
AND ent_voyage.IDPortDe = portD.IDport
AND ent_voyage.IDPortA = portL.IDport
AND P.idTypeClasse IN( 1 ,2 )
GROUP BY
ent_contrat.contrat ,
ent_contrat.date_debut ,
ent_contrat.date_fin ,
ent_voyage.IDcontrat ,
portL.nom,
portD.nom |
Partager