Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- A1.AUFTRAGSNUMMER AS "Order number",
- A1.AEXTERNAUFTRAGSNR AS "Client reference",
- SKUNDEN.NAME1 AS "Client name",
- SKUNDEN.MAINLAND AS "Country of the client",
- SHIER.NR AS "Number of organisation",
- SHIER.BEZEICHNUNG AS "Name of organisation",
- TOURNUMMER AS "Number of Tour",
- CASE
- WHEN AT.LKWKZ IS NOT NULL THEN AT.LKWKZ
- ELSE AT.ANHAENGERKZ
- END AS "License plate",
- TO_CHAR(ATASEND.VONLADEDATUM, 'DD-MM-YYYY') AS "First loading date"
- FROM
- AKOPF A1
- LEFT JOIN
- SHIERARCHIE SHIER ON SHIER.ID = A1.HIERARCHIE
- LEFT JOIN
- ASENDUNG ON A1.NR = ASENDUNG.AKOPFNR
- LEFT JOIN
- ATASEND ON ATASEND.ASENDUNGID = ASENDUNG.SENDUNGID
- LEFT JOIN
- ATOUR AT ON AT.NR = ATASEND.TOURNR
- LEFT JOIN
- SKUNDEN ON SKUNDEN.NR = A1.FRACHTAGNR
- WHERE
- (AT.LKWKZ IS NOT NULL OR AT.ANHAENGERKZ IS NOT NULL)
- -- AND ATASEND.VONLADEDATUM IS NOT NULL;
- AND A1.AUFTRAGSNUMMER = 908243
- ORDER BY
- ATASEND.VONLADEDATUM ASC
- FETCH FIRST ROW ONLY;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement