I need to execute a select statement that returns all rows where the column value is no different (e.g. EmailAddress).
For example, if the table looks like this:
CustomerName EmailAddress Aaron aaron@gmail.com Christy aaron@gmail.com Jason jason@gmail.com Eric eric@gmail.com John aaron@gmail.com
I need a request to return:
Aaron aaron@gmail.com Christy aaron@gmail.com John aaron@gmail.com
I read a lot of posts and tried different queries to no avail. The request, which I believe should work below. Can someone suggest an alternative or say what could be wrong with my request?
select EmailAddress, CustomerName from Customers group by EmailAddress, CustomerName having COUNT(distinct(EmailAddress)) > 1
sql sql-server sql-server-2008
Grasshopper Oct 30 '12 at 19:30 2012-10-30 19:30
source share