I\'m stuck with a problem I don\'t know how to solve. Here\'s what my table \'myTable\' look like:
+----------+-------------+------+-----+---------+---------
As you need to count distinct name you need to use distinct keyword.
distinct
Try this query
select one, count(distinct two) as cnt from tbl group by one
| ONE | CNT | --------------- | cat | 2 | | dog | 3 | | mouse | 1 |