So I have a list of ID's that later put a string to describe the issue.
I want to filter these out by their id and display a string based on the primary id#
count(sol.id) `Solution Count`,
case sol.id when 8,9,10,11,12,13,14,15,16,25,29,33,37,40,41,42,48,51 then 'Hardware'
else 'Software' end `HW/SW`
from tickets t
join ticket_solutions tsol
on tsol.ticket_id =t.id
join solutions sol
on tsol.solution_id = sol.id
Since your description is not 100% clear here is just my guess:
SELECT sol.solution `Solution`, COUNT(t.id) `Solution Count`, IF(sol.id IN (8,9,10,11,12,13,14,15,16,25,29,33,37,40,41,42,48,51),'Hardware','Software') `HW_SW` FROM tickets t JOIN ticket_solutions tsol ON tsol.ticket_id =t.id JOIN solutions sol ON tsol.solution_id = sol.id GROUP BY sol.id