Advertisement
horozov86

Task 21 - SQL

Oct 18th, 2024
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.39 KB | None | 0 0
  1. SQLSkript V2.0
  2. --History
  3. --18.10.2024 Georgi Horozov
  4.  
  5. stat:Name=Gopet_ClientsAndAddresses
  6. stat:HelpContext_Dlg=01012267632132312024
  7. stat:Modules=carlo
  8. stat:CheckSum=E7BF7721421162024
  9. ALLROWS
  10.  
  11. IN:var_LoadingDateActual:timespace:Actual loading DATE
  12.  
  13.  
  14. OUT:Truck NUMBER:Truck NUMBER:atour.LKWKZ::COUNT:1
  15. OUT:Trailer NUMBER:Trailer NUMBER:atour.ANHAENGERKZ::COUNT:2
  16. OUT:GOPET LOGISTICS EOOD AS Sender:GOPET LOGISTICS EOOD AS Sender:SK.NAME1::COUNT:3
  17. OUT:Loading DATE WHEN Sender IS GOPET LOGISTICS EOOD:Loading DATE WHEN Sender IS GOPET LOGISTICS EOOD:CASE WHEN SK.KUNDENNR = 23164813 THEN LADEDATUMSTARTIST END::COUNT:4
  18. OUT:GOPET LOGISTICS EOOD AS Receiver:GOPET LOGISTICS EOOD AS Receiver:SKU.NAME1::COUNT:5
  19. OUT:Unloading DATE WHEN Receiver IS GOPET LOGISTICS EOOD:Unloading DATE WHEN Receiver IS GOPET LOGISTICS EOOD:CASE WHEN SKU.KUNDENNR = 23164813 THEN LIEFERDATUMENDEIST END::COUNT:6
  20. OUT:Carrier name:Carrier name:S.NAME1::COUNT:7
  21. OUT:Tour NUMBER:Tour NUMBER:ATOUR.TOURNUMMER::COUNT:8
  22.  
  23.  
  24.  
  25. *SELECT*
  26. FROM ATOUR
  27. JOIN ATASEND ON ATOUR.NR = ATASEND.TOURNR
  28. JOIN ASENDUNG ON ASENDUNG.SENDUNGID = ATASEND.ASENDUNGID
  29. JOIN SKUNDEN S ON S.NR = ATOUR.UNTERNEHMER
  30. JOIN SKUNDEN SK ON SK.NR = ASENDUNG.ABSNR
  31. JOIN SKUNDEN SKU ON SKU.NR = ASENDUNG.EMPFNR
  32.  
  33. WHERE LADEDATUMENDEIST >= :var_LoadingDateActual
  34. AND LADEDATUMENDEIST <= :var_LoadingDateActual
  35. AND (SK.KUNDENNR = 23164813 OR SKU.KUNDENNR = 23164813);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement