select
  t.id AS id,
  z.jmeno AS zastavka,
  t.vzdalenost AS vzdalenost
FROM
  trasa t,
  zastavka z,
  spoje s
WHERE
  t.id_zastavka = z.id AND
  t.id_spoje = s.id AND
  s.id = (
    SELECT id_spoje FROM trasa WHERE id = 1
  )
ORDER BY t.poradi ASC;