SQL MAX() with HAVING, WHERE, IN - w3resource

PHOTO EMBED

Tue Oct 11 2022 14:30:09 GMT+0000 (Coordinated Universal Time)

Saved by @mvieira #sql

SELECT agent_code,COUNT(agent_code),MAX(ord_amount) 
FROM orders 
GROUP BY agent_code 
HAVING MAX(ord_amount) IN(500,800,2000);
content_copyCOPY

https://www.w3resource.com/sql/aggregate-functions/Max-having.php