SQL Dojo Beta
Indicatore

Tasso di annullamento

Gli ordini annullati divisi per tutti gli ordini, in percentuale.
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;
orderscancelledcancel_rate_pct
25001496.0
Provalo in Randori