Example:
SELECT partnumber, manufacturer, condition, SUM(qty), AVG(price), description FROM parts
WHERE [something]
GROUP BY partnumber, manufacturer, condition
I have some descriptions that are blank, and there can be many partnumber, manufacturer, condition values, and on the group it seems to take the first description available, which can be blank. I'd like to get the longest description available.
I tried this:
MAX(LENGTH(description))
however, that returns the number of characters in the string. Is it possible to do what I'm trying to do in MySQL?