Code: Select all
| id_txn | way_pay | payment_meth |
| 123435 | gateway | transfer
| 433564 | on-site | cash
| 354641 | gateway | cash
| 124553 | paypal | transfer
Code: Select all
select
case when way_pay in ('gateway','paypal') and payment_meth = 'transfer' then 'paypal' else way_pay
end way_pay,payment_meth,
count(distinct id_txn) as ttl_pays
from
pays
where
init_date between trunc(sysdate-7) and trunc(sysdate)
group by
case when way_pay in ('gateway','paypal') and payment_meth = 'transfer' then 'paypal' else way_pay end,
payment_meth
< /code>
Ergebnisse: < /p>
way_pay | payment_meth | ttl_pays
gateway | transfer | 23435
Code: Select all
way_pay | ttl_pays
gateway | 123214
on-site | 32674