Mysql match on two columns and get count
@Abdul's answer just needs HAVING COUNT(*) &gt; 1

The query shold look like this now

SELECT COUNT(*), col1 , col2 FROM test GROUP BY col1,col2 HAVING COUNT(*) &gt; 1;


Here is the execution of it:

mysql&gt; create table test(col1 varchar(20),col2 varchar(20));
Query OK, 0 rows affected (0.33 sec)

mysql&gt; INSERT INTO test VALUES('Joe','April'),('Fred','May'),
    -&gt; ('Sam','April'),('Joe','April'),('Mark','Jan'),('Joe','Dec');
Query OK, 6 rows affected (0.06 sec)
Records: 6  Duplicates: 0  Warnings: 0

mysql&gt; SELECT COUNT(*), col1 , col2 FROM test GROUP BY col1,col2 HAVING COUNT(*) &gt; 1;
+----------+------+-------+
| COUNT(*) | col1 | col2  |
+----------+------+-------+
|        2 | Joe  | April |
+----------+------+-------+
1 row in set (0.24 sec)

mysql&gt;


If you do not care for the count, remove it from the SELECT clause

mysql&gt; SELECT col1 , col2 FROM test GROUP BY col1,col2 HAVING COUNT(*) &gt; 1;
+------+-------+
| col1 | col2  |
+------+-------+
| Joe  | April |
+------+-------+
1 row in set (0.00 sec)

mysql&gt;


Give it a Try !!!