COALESCE can fill the NULL produced by a CASE expression with no matching WHEN branch.

highlighted = computed this step

Input table

Start with shipment rows and late-day counts.

Shipments\text{Shipments}
Shipmentsorder_idstatusdays_lateo1late3o2on_time0o3late8

Select query

Let CASE return an escalation label only for rows above the threshold, then use COALESCE for the fallback label.

COALESCE CASE result with default\text{COALESCE CASE result with default}
SELECT CASE then COALESCE defaultselect order_id,late_statusarity 2 rows 3Shipmentsarity 3 rows 3

Output table

Rows without a CASE match receive the fallback label instead of NULL.

filled conditional label\text{filled conditional label}
Outputorder_idlate_statuso1monitoro2monitoro3escalate