我要问:
SELECT COUNT(*), SUBSTR(datetime_acc, 1, 10), type_acc FROM payment_acc WHERE type_acc LIKE %monthly% GROUP BY SUBSTR(datetime_acc, 1, 10), type_acc ORDER BY datetime_acc, type_acc
count date type_acc ------ ---------- --------------- 4 2011-01-20 monthly payment 3 2011-01-20 failed monthly 5 2011-01-21 monthly payment 10 2011-01-22 failed monthly 11 2011-01-22 monthly payment 1 2011-01-23 monthly payment 4 2011-01-24 monthly payment 1 2011-01-24 failed monthly 6 2011-01-25 failed monthly 6 2011-01-25 monthly payment 16 2011-01-26 failed monthly 10 2011-01-26 monthly payment
但是,我试图让失败,并在不同的栏目中一行走。
success failed date ------- ------ ---------- 4 3 2011-01-20 5 10 2011-01-21 11 NULL 2011-01-22 1 NULL 2011-01-23 4 1 2011-01-24 6 6 2011-01-25 10 16 2011-01-26
Any clues?