これら 2 つのクエリを 1 つのクエリに結合することは可能ですか?
SELECT sum(amount) as credit FROM statement WHERE userId= '33003' AND debitOrCredit = '1' AND actionDate <= '2012-10-17';
SELECT sum(amount) as debit FROM statement WHERE userId= '33003' AND debitOrCredit = '0' AND actionDate <= '2012-10-17';
だから私は結果を得る:
| credit | debit |
| 90 | 60 |