如何选择列中具有相同值的所有行?
SELECT * FROM messages WHERE count(mcc) > 1 // total all same of value for column mcc > 1
仅338,338,338,340,340等。不是330,316,334因为它们没有相同的值
答案 0 :(得分:2)
您可以尝试此查询: -
SELECT * FROM messages
WHERE mcc in (SELECT mcc FROM messages
GROUP BY mcc
HAVING COUNT(mcc) > 1)