That doesn't work. That would show me ID 5 as well - but I'm only interested in the IDs for which ALL SubIDs are "Fixed" (and for ID 5, one of the SubIDs is "Unfixed").
WITH cte AS (
SELECT ID, MAX(SubID) AS MAXID, SUM(CASE WHEN Category = 'Fixed' THEN 1 ELSE 0 END) AS CountFixed
FROM Tab
GROUP BY ID
)
SELECT ID FROM cte WHERE MAXID = CountFixed;
No, not really. The difference is that WHERE would include IDs that had values in Category other than 'Fixed', such as 'Unfixed';. Your own code using WHERE demonstrated that, as aytri commented. The MIN/MAX technique makes sure that the ONLY value present is 'Fixed', which matches the requested requirement.