That’s happening because column m.unit is used in the SELECT clause but not in the GROUP BY clause. This is a perfectly valid and reasonable response from our DBMS, but in this exceptional case, ...