select email,min(id) from Person group by email
This is very simple sql right? How's possible it return duplicate emails?
The question is "Write a SQL query to delete all duplicate email entries in a table named Person", you should delete the mismatch data from Person.
min is aggregate and returns only one value. Selection of aggregate and multi-valued column will result in error.
@xiangyucao yes, quite odd that I encounter the same issue and seems there is a trick for leetcode to return result in JSON format. Tried this on other online and my own mysql, It's got returned normally.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.