MySQL – Get Column Group with Different Values on Another Column

MySQL

I have the following table:

week       status
-------    ------
102014     1
102014     1
102014     1
112014     2
112014     2
112014     2
122014     2
122014     0
122014     0
132014     1
132014     1
132014     1
142014     2
142014     2
142014     2

How can I get 122014 which has different values on status?

Best Answer

SELECT week, GROUP_CONCAT(DISTINCT status)
    FROM tbl
    GROUP BY week
    HAVING COUNT(DISTINCT status) > 1;