我正在尝试编写一个查询 - 我在数据库上有1000个用户,并希望找到包含多个条目的用户
SELECT * , COUNT( * ) AS number
FROM `users`
WHERE `id` >309438
GROUP BY email and `number` > 1
我不认为我在一百万英里之外..
答案 0 :(得分:2)
SELECT email, COUNT(*) AS number
FROM users
WHERE id > 309438
GROUP BY email
HAVING number > 1