I am pretty new to SQL.
When I have a list like this
+----+------+
| id | name |
+----+------+
| 1 | Mike |
+----+------+
| 1 | Mike |
+----+------+
| 2 | Mike |
+----+------+
| 2 | Mike |
+----+------+
| 2 | Mike |
+----+------+
| 5 | Sam |
+----+------+
| 6 | Sam |
+----+------+
| 7 | Sam |
+----+------+
| 7 | Sam |
+----+------+
and I want to count how many unique Mikes and Sams there are. So the output would be
+------+---+
| Mike | 2 |
+------+---+
| Sam | 3 |
+------+---+
How would I do that?
Edit:
This was just an example for my problem. The code would be something like SELECT id, name FROM id, name WHERE some conditions
And I tried something like SELECT id, name, COUNT(*) From id,name WHERE some conditions GROUP BY id, name
and the output is not what I want. It just counts how many Mikes and Sams there are. But I want how many unique Mikes and Sams there are