标签: ms-access
我的查询中包含一定数量的交易列(美元金额)和付款类型列(现金,支票,CC)。有没有办法查询用现金支付的所有交易金额并获得总额,用信用卡支付并获得总额,支票支付并获得总额?
答案 0 :(得分:3)
select payment_type, sum(transaction_amount) from yourtable group by payment_type
这将为每种付款类型返回一行,以及通过该类型支付的总金额。