1 2 3 4 5 6 7 8 9 10 11
| SELECT a.id_ligne AS ligne, a.ville AS Ville_départ,a.lieu, substring( convert( a.heure, char ) , 1, 5 ) AS Heure_départ, b.ville AS Ville_arrivée,b.lieu, substring( convert( b.heure, char ) , 1, 5 ) AS Heure_arrivée, c.jours, c.special,c.depart_arrivee,d.nom_transporteur,ucase(d.type_transporteur), d.ville_transporteur,d.site_transporteur
FROM horaires a, horaires b,ligne c, transporteur d
WHERE a.id_ligne=c.id_ligne
and c.id_transporteur=d.id_transporteur
AND a.id_ligne = b.id_ligne
and (a.ville like '%$depart%' or soundex( a.ville) = soundex( '$depart' ))
AND (b.ville like '%$arrivee%' or soundex( b.ville) = soundex( '$arrivee' ))
AND a.ordre < b.ordre
AND a.heure >= '$hd'
AND a.heure <= '$ha'
order by d.type_transporteur |
Partager