Skip to content
Advertisement

Mysql – How to query a column for duplicates values but have different values in a different column?

I have a table with the following structure:

I am trying to query for all duplicate emails that have different values in the Unsubscribed column. I want to return something like this based on the above example:

Advertisement

Answer

It think you just want this:

The HAVING clause would only assert to true if a given email appeared with more than one value for unsubscribed.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement