As @Marc B says in the comments, this sounds like a trick question. But if it's not...
The only solution I know of (without being aware of a proper ranking function in mysql) is to somehow loop through each name and running the following query:
DELETE FROM tbl_name
WHERE name=@name
LIMIT 1
This wouldn't be one query so it wouldn't be a valid answer but I'm not sure of any other way to do it in mysql.
Another option would be to use SELECT DISTINCT
into a temp table, TRUNCATE the original table, and INSERT the records back into it from a temp table. Again, this doesn't satisfy the requirements.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…