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


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.

| improve this answer | |
  • Thanks danblack! Works well. – Andre Silva May 6 '19 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.