HAVING can filter grouped rows after MAX(amount) has been computed.
highlighted = computed this step
Input table
Use grouped sales rows with one NULL amount.
Group query
Group by category, take the maximum non-NULL amount, then apply HAVING.
GROUP BY category HAVING MAX(amount)
Grouped output
Only the group whose maximum amount is above the threshold remains.
max-filtered groups