You can't mix integers and varchar with the same function.Either trySELECT ResultType, MAX(CASE ResultDesc WHEN 'Labelled' THEN RESULT ELSE '0' END) AS 'Labelled', MAX(CASE ResultDesc WHEN 'Weight' THEN RESULT ELSE '0' END) AS 'weight', MAX(CASE ResultDesc WHEN 'Size' THEN RESULT ELSE '0' END) AS 'Size'FROM Tablename GROUP BY ResultType
orSELECT ResultType, MAX(CASE ResultDesc WHEN 'Labelled' THEN LTRIM(STR(RESULT)) ELSE '0' END) AS 'Labelled', MAX(CASE ResultDesc WHEN 'Weight' THEN LTRIM(STR(RESULT)) ELSE '0' END) AS 'weight', MAX(CASE ResultDesc WHEN 'Size' THEN LTRIM(STR(RESULT)) ELSE '0' END) AS 'Size'FROM Tablename GROUP BY ResultType
Peter LarssonHelsingborg, Sweden