I need to delete the duplicate records in this table. However, there is no id for each row.
Example Data
| product | amount | quantity |
|---|---|---|
| table | 2000 | 5 |
| chair | 300 | 25 |
| TV | 30000 | 4 |
| bike | 300 | 25 |
| table | 2000 | 5 |
| chair | 300 | 25 |
| chair | 300 | 25 |
Expected Results
I need to get this result.
| product | amount | quantity |
|---|---|---|
| table | 2000 | 5 |
| chair | 300 | 25 |
| TV | 30000 | 4 |
| bike | 300 | 25 |
Script with ID
If there were an id, I could have used:
DELETE p1 FROM products p1
INNER JOIN products p2
WHERE p1.id < p2.id AND p1.product = p2.product;