Successful revenue by method (ClickHouse)

Successful revenue by method (ClickHouse)

In payments, for each method compute revenue — the sum of amount over rows with status = 'success' only (failed/refunded are excluded). Use sumIf. Order by method. Columns: method, revenue.

Expected output sample

methodrevenue
card510.00
crypto300.00
paypal200.00
PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid