Success rate by payment method (ClickHouse)
Success rate by payment method (ClickHouse)
In payments, for each method compute the total number of transactions total = count(), the number of successful ones successes = rows with status = 'success', and success_rate = successes / total rounded to 4 decimals. The denominator count() is always > 0 inside a group. Use countIf. Order by method. Columns: method, total, successes, success_rate.
Exemplo de resposta esperada
| method | total | successes | success_rate |
|---|---|---|---|
| card | 5 | 4 | 0.8 |
| crypto | 2 | 1 | 0.5 |
| paypal | 2 | 1 | 0.5 |
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
EntrarFocus radio
Paused · SomaFM · Fluid