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
Colin 't Hart
9,51015 gold badges37 silver badges44 bronze badges
1 Answer 1
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.
answered May 4, 2019 at 2:27
-
Thanks danblack! Works well.Andre Silva– Andre Silva2019年05月06日 18:42:21 +00:00Commented May 6, 2019 at 18:42
lang-sql