Mysql – combine rows from table with NUM columns

MySQLrow

I have this table:

Product | Qtdy | Price    
A       | NULL | 123.00    
A       | 23   | NULL

How Can I represent convert like that?

Product | Qtdy | Price    
A       | 23   | 123.00

Which means group by product using Null to return value print in the next line?

Thank you

Best Answer

Here's one way.

SELECT Product, MAX(Qtdy), MAX(Price)
FROM table
GROUP BY Product

The better answer is to clean up your data so it isn't ditry.