WannaLearn
Programmer
I want to find all email addresses in my users table that exist more than once, this works:
The above code brings back one email and shows that it appered twice.
Now, when I try to add more fields to the select clause, I get back no results. I added:
So how can I get this to work with adding more fields? And why doesn't it work with those new fields added?
Thank you.
Code:
select email, count(email) as emailcount
from users
where user_id > 7146375
group by email
HAVING COUNT(email) > 1
Now, when I try to add more fields to the select clause, I get back no results. I added:
Code:
select user_id, email, count(email) as emailcount, FirstName, LastName, Address, Phone, City, State, Zip,
Country, BirthMonth, BirthDay, BirthYear, Gender, IPAddress, gift
from users
where user_id > 7146375
group by user_id, email, FirstName, LastName, Address, Phone, City, State, Zip,
country, BirthMonth, BirthDay, BirthYear, Gender, IPAddress, gift
HAVING COUNT(email) > 1
So how can I get this to work with adding more fields? And why doesn't it work with those new fields added?
Thank you.