Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT
- SKUNDEN.NAME1 AS "Name of carrier",
- ATOUR.TOURNUMMER AS "Tour number",
- ATOUR.PREISVORGABEBETRAGGS AS "Price for transport",
- SWAEHRUNG.ISOWAEHRUNGSCODE AS "Currency",
- MIN(ATASEND.VONLADEDATUM) AS "Loading date",
- MAX(ATASEND.VONLIEFERDATUM) AS "Unloading date",
- SHIERARCHIE.EXTERNEREFERENZ1 AS "Team",
- CONCAT(CONCAT(ATOUR.LKWKZ, '/') ,ATOUR.ANHAENGERKZ) AS "Truck and Trailer number"
- FROM
- ATOUR
- LEFT JOIN
- SKUNDEN ON SKUNDEN.NR = ATOUR.UNTERNEHMER
- LEFT JOIN
- ATASEND ON atour.NR = atasend.TOURNR
- LEFT JOIN
- SHIERARCHIE ON SHIERARCHIE.ID = ATOUR.HIERARCHIE
- LEFT JOIN
- swaehrung ON SWAEHRUNG.ID = ATOUR.PREISVORGABEWAEHRUNGIDGS
- GROUP BY
- SKUNDEN.NAME1,
- ATOUR.TOURNUMMER,
- ATOUR.PREISVORGABEBETRAGGS,
- SWAEHRUNG.ISOWAEHRUNGSCODE,
- SHIERARCHIE.EXTERNEREFERENZ1,
- ATOUR.LKWKZ,
- ATOUR.ANHAENGERKZ
- ORDER BY
- ATOUR.TOURNUMMER DESC,
- MIN(ATASEND.VONLADEDATUM) ASC,
- MAX(ATASEND.VONLIEFERDATUM);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement