[英]Microsoft Access Query
I have a query that has a amount of transaction column (dollar amount) and a payment type column (cash, check, CC).我有一个查询,其中包含交易金额(美元金额)和支付类型列(现金、支票、抄送)。 Is there a way to query all amount of transactions that are paid with cash and get a total, paid with credit card and get a total, paid with a check and get a total?
有没有办法查询所有用现金支付的交易金额并获得总额,用信用卡支付并获得总额,用支票支付并获得总额?
select payment_type, sum(transaction_amount)
from yourtable
group by payment_type
That'll return a row for each payment type, along with the total amount paid via that type.这将为每种付款类型返回一行,以及通过该类型支付的总金额。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.