Discuss How can I select a common rows in a table in the MySQL Help forum on Dev Shed. How can I select a common rows in a table MySQL Help forum discussing administration, SQL syntax, and other MySQL-related topics. MySQL is an open-source relational database management system (RDBMS).
Time spent in forums: 1 Month 1 Week 2 Days 22 h 28 m 30 sec
Reputation Power: 1623
I believe they want, where col1 is 5 or 11, all the values of col2 where there are duplicate col2 values.
WHERE col1 in (5, 11)
GROUP BY col2
HAVING COUNT(col2) > 1
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc