My question may sound weird, but please bear with me. This is what I have:
Table Products:
ProductName Cost Pen A 1.00 Pen A 1.00 Pen B 1.00 Pen A 2.00 Pen C 3.00 Pen C 3.00 Pen C 3.00 How do I remove true duplicates from this? If you look at the data, you can see that Pen C has three rows with exact same data. Pen A has 2 rows with same data and 1 with a different cost. I don't want to eliminate "Pen A".
A simple group by statement like this:
SELECT ProductName,Cost FROM PRODUCTS GROUP BY ProductName,Cost HAVING COUNT(*) > 1 This wont' work since it'll pick up "PEN A" as well.
Any help is appreciated. Thank you!
SELECT DISTINCT ProductName,Cost FROM PRODUCTSnot return what you want?PRIMARY KEYin tables.