LMSouq
database Open

Remove duplicate rows in MySQL

CH
Chetan
1 month ago
3 views
Problem Description
I have a table with the following fields: id (Unique) url (Unique) title company site_id Now, I need to remove rows having same `title, company and site_id`. One way to do it will be using the following SQL along with a script (**PHP**): SELECT title, site_id, location, id, count( * ) FROM jobs GROUP BY site_id, company, title, location HAVING count( * ) >1 After running this query, I can remove duplicates using a server side script. But, I want to know if this can be done only using SQL query.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base