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
| method | revenue |
|---|---|
| card | 510.00 |
| crypto | 300.00 |
| paypal | 200.00 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inFocus radio
Paused · SomaFM · Fluid