Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- LKWKZ AS "Truck number",
- ANHAENGERKZ AS "Trailer number",
- SK.NAME1 AS "GOPET LOGISTICS EOOD as Sender",
- CASE WHEN SK.KUNDENNR = 23164813 THEN LADEDATUMSTARTIST END AS "Loading date when Sender is GOPET LOGISTICS EOOD",
- SKU.NAME1 AS "GOPET LOGISTICS EOOD as Receiver",
- CASE WHEN SKU.KUNDENNR = 23164813 THEN LIEFERDATUMENDEIST END AS "Unloading date when Receiver is GOPET LOGISTICS EOOD",
- S.NAME1 AS "Carrier name",
- TOURNUMMER AS "Tour number"
- FROM ATOUR
- JOIN ATASEND ON ATOUR.NR = ATASEND.TOURNR
- JOIN ASENDUNG ON ASENDUNG.SENDUNGID = ATASEND.ASENDUNGID
- JOIN SKUNDEN S ON S.NR = ATOUR.UNTERNEHMER
- JOIN SKUNDEN SK ON SK.NR = ASENDUNG.ABSNR
- JOIN SKUNDEN SKU ON SKU.NR = ASENDUNG.EMPFNR
- WHERE LADEDATUMENDEIST >= TO_DATE('01-01-2023', 'dd-mm-yyyy')
- AND LADEDATUMENDEIST <= TO_DATE('31-12-2023', 'dd-mm-yyyy')
- AND (SK.KUNDENNR = 23164813 OR SKU.KUNDENNR = 23164813);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement