我需要为销售额计算出 10% 的回扣值,但不确定该怎么做。我是 SQL 新手,感谢您的帮助。
select customer_code, invoice_date, sales_order_number, product_code,
qty_inv, sales_value, b.mpn
from sales_summary as a
INNER JOIN stock_summary as b ON a.product_code = b.part
where invoice_date > date_trunc('month', CURRENT_DATE) - INTERVAL '3 months'
and customer_code in ('SSMIDC3','SSMIDC2','SBERDC2','STWYB','SSMIDCE')
最佳答案
你在找这个吗?
select customer_code, invoice_date, sales_order_number, product_code,
qty_inv, sales_value, b.mpn,
(0.1 * sales_value) as rebate_value
. . .
关于sql - 计算销售值(value)的 10% 回扣,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50152423/