Is it possible to delete perfect duplicate records from mysql, without creating a temporary table in a single query????
INSERT INTO `test` (`fruit`, `price`) VALUES
('apple', 10),
('grape', 50),
('apple', 10),
('orange', 100),
('orange', 100),
('orange', 100),
('pinaple', 200),
('pinaple', 200),
('pinaple', 200),
('pinaple', 200);
and the result should be
"apple","10"
"orange","100"
"pinaple","200"
"grape","50"
in a single query
Description:
If there is any uniquely identifiable fields then remove the duplicates like this Remove duplicate rows in MySQL
If the there is only one particular item then can be able to remove the duplicates by using limit of delete query
DELETE FROM
table_name
WHEREcolumn_name
='value' LIMIT 1;Multi line solution link2