You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
578 B
Plaintext
17 lines
578 B
Plaintext
SELECT CUSTOMER_NO AS Customer,
|
|
CUSTOMER_NAME,
|
|
ACCT_CURRENCY_CODE AS Currency,
|
|
SUM(NET_AMOUNT) AS Sales,
|
|
SUM(INVOICED_QTY) AS Quantity
|
|
|
|
FROM CUST_ORD_INVO_STAT t
|
|
|
|
Where (TRUNC(INVOICE_DATE) >= TO_DATE('&Valid_From', 'MM/DD/YYYY') AND
|
|
TRUNC(INVOICE_DATE) <= TO_DATE('&Valid_To', 'MM/DD/YYYY'))
|
|
AND COMPANY LIKE '%&Company%'
|
|
AND AUTHORIZE_CODE LIKE '%&Coordinator%'
|
|
AND CUST_GRP LIKE '%&Customer_Statistics_Group%'
|
|
|
|
GROUP BY CUSTOMER_NO, CUSTOMER_NAME, ACCT_CURRENCY_CODE
|
|
ORDER BY Sales DESC, Quantity DESC
|
|
FETCH NEXT 10 ROWS ONLY |