我有一个包含列的表格 - InvDate
、CustName
、InvAmt
、PayType
和PaidAmt
。客户可以通过现金、支票或信用卡 ( PayType
) 支付金额。现在基于这张表,我想要这样的东西:
SELECT InvDate, CustName, InvAmt,
(PaidAmt as CashPay Where PayType = 'Cash'),
(PaidAmt as CheqPay WHERE PayType = 'Cheque'),
(PaidAmt As CCPay WHERE PayType = "CC') FROM Invoice