Gruppe durch Ignorieren der Spalte in OracleJava

Java-Forum
Anonymous
 Gruppe durch Ignorieren der Spalte in Oracle

Post by Anonymous »

Ich habe eine wöchentliche Anzahl, in der ich die ID_TXN, die Zahlungsmethode und die Art zu bezahlen habe, aber ich habe eine Ausnahme und das heißt, wenn ich ein bestimmtes Szenario habe.

Code: Select all

| id_txn | way_pay | payment_meth |
| 123435 | gateway | transfer
| 433564 | on-site | cash
| 354641 | gateway | cash
| 124553 | paypal  | transfer
Aber ich möchte die Spalte Way_Pay im Abfrageergebnis ignorieren. Meine Abfrage: < /p>

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

Ich möchte alle Transaktionen ohne Filter, jedoch ohne payment_meth Spalte:

Code: Select all

 way_pay | ttl_pays

gateway |  123214
on-site |  32674
Wie kann das erreicht werden?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post