I\'ve given a client the following query to delete duplicate phone no. records in an MSSQL database, but now they need to also do it on MySQL, and they report that MySQL com
MySQL complains, because it makes no sense. You trying to aggregate using min() column by which you group.
Now, if you're trying to delete duplicate phone numbers for the same person, the SQL should be:
delete from bkPhone
where phoneId not in
(
select min(phoneId)
from bkPhone
group by firstName,lastName /* i.e. grouping by person and NOT grouping by phoneId */
having count(*) >= 1
)