我正在尝试这段代码:
SELECT Email FROM
(SELECT Email, COUNT(Email) AS cnt
FROM Person
GROUP BY Email
HAVING cnt(*) >1 )
这是我收到的错误:
Runtime Error Message: Line 6: SyntaxError: near '*) >1 )'
Last executed input: {"headers": {"Person": ["Id", "Email"]}, "rows": {"Person": []}}
答案 0 :(得分:3)
console.log
您根本不需要嵌套查询。
答案 1 :(得分:1)
SELECT Email
FROM Person
GROUP BY Email
HAVING COUNT(*) >1
SQL FIDDLE
答案 2 :(得分:0)
select p.email from person p
join (
SELECT Email, COUNT(Email) AS cnt
FROM Person
GROUP BY Email
HAVING count(email) > 1) s
on s.email = p.email
您无法在having
或where
子句中使用列的别名。