Kennzahl
Stornoquote
Stornierte Bestellungen geteilt durch alle Bestellungen, in Prozent.
SELECT ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'cancelled') / COUNT(*), 1)
FROM orders;
SELECT COUNT(*) AS orders,
COUNT(*) FILTER (WHERE status = 'cancelled') AS cancelled,
ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'cancelled') / COUNT(*), 1) AS cancel_rate_pct
FROM orders;
| orders | cancelled | cancel_rate_pct |
|---|---|---|
| 2500 | 149 | 6.0 |