Advertisement
horozov86

Task 14 - SQL

Oct 9th, 2024 (edited)
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.03 KB | None | 0 0
  1. SELECT DISTINCT
  2. AUFTRAGSNUMMER AS "Order number",
  3. FAKTURANR AS "Invoice number",
  4. FAKTURADATUM AS "Invoice date",
  5. FAKTURASUMME AS "Invoice price",
  6. ISOWAEHRUNGSCODE AS "Currency",
  7. SKUNDEN.NAME1 AS "Invoice receiver",
  8. TOURNUMMER AS "Tour number",
  9. CONCAT(CONCAT(ATOUR.LKWKZ, '/') ,ATOUR.ANHAENGERKZ) AS "Truck and Trailer number",
  10. VONLADEDATUM AS "Loading date",
  11. VONLIEFERDATUM AS "Unloading date"
  12. FROM
  13.  
  14. AKOPF
  15. LEFT JOIN
  16.     ASENDUNG ON AKOPF.NR = ASENDUNG.AKOPFNR
  17. LEFT JOIN
  18.     ASDGABRECHNUNG ON ASENDUNG.SENDUNGID = ASDGABRECHNUNG.ASENDUNGID
  19. LEFT JOIN
  20.     AFAKTURA ON AFAKTURA.IDAFAKTURA = ASDGABRECHNUNG.FK_IDAFAKTURA
  21. LEFT JOIN
  22.     SWAEHRUNG ON SWAEHRUNG.ID = AFAKTURA.WAEHRUNGID
  23. LEFT JOIN
  24.     SKUNDEN ON SKUNDEN.NR = AFAKTURA.FAKTURAPARTNER
  25. LEFT JOIN
  26.     ATASEND ON ASENDUNG.SENDUNGID = ATASEND.ASENDUNGID
  27. LEFT JOIN
  28.     ATOUR ON ATOUR.NR = ATASEND.TOURNR
  29.  
  30. WHERE
  31.     FAKTURANR IS NOT NULL AND AUFTRAGSNUMMER IN (867315, 851463, 849229, 849692, 851585, 850456, 851610, 849242, 851213, 849694)
  32. ORDER BY
  33.     AUFTRAGSNUMMER;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement