Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

How to mysql delete duplicate rows in a table without id?

Asked by Buffy Heaton Mar 13, 2023 1.7K views 1 answer
Share

About this question

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 xss=removed>

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.