In reply to: https://www.jvt.me/mf2/2023/11/imcyu/

Not sure that can work directly with the GROUP_BY query, but I tried below with only SUM and IF. It will depend on how the "quantity" of each type works. Below assumes it's quantity=1 for each.

SELECT
	SUM(IF(advisory_type = 'SECURITY', 1, 0)) AS total_security
	,SUM(IF(advisory_type = 'DEPRECATED', 1, 0)) AS total_deprecated
FROM
	example_table
WHERE
	-- conditions
GROUP BY
	-- need to group by something here

Responses

Jamie Tanna Jamie Tanna
Thank you, that's helped me get there with the changes I needed 🏼