Answer the question
In order to leave comments, you need to log in
How to sort table by DISTINCT but select all fields?
There is a table with a bunch of fields. It also contains a bunch of duplicate entries. I need to filter them by two fields, title and phone. Let's say I sort using DISTINCT, half of the 7000 records remain (duplicates are eliminated). But if you save, then only these fields are saved. I need to sort by two fields but still select all to keep. What request can be made? Or maybe there are ways in PHP?
UPDATE
SELECT * FROM `companies` GROUP BY title, phone
In this case, is this the correct query to weed out duplicates?
UPDATE 2
Issue resolved.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question