我有下表:
+-------+------------------+-----------------------+-------------------+------+
| id | A_id | B_id | C_id | age |
+-------+------------------+-----------------------+-------------------+------+
| 44 | 22 | 22 | 22 | 35 |
| 47 | 6 | NULL | 6 | 33 |
| 48 | 4 | NULL | 4 | 32 |
| 52 | 23 | NULL | 23 | 37 |
| 54 | 9 | 9 | NULL | 37 |
| 55 | NULL | 8 | NULL | 29 |
| 60 | 8 | NULL | 8 | 37 |
| 62 | 8 | NULL | 8 | 35 |
| 65 | 11 | NULL | 11 | 46 |
| 69 | 9 | NULL | 9 | 52 |
+-------+------------------+-----------------------+-------------------+------+
我想计算具有某些值的总行数,即:
_id - count(id)
22 - 1
6 - 1
4 - 1
23 - 1
9 - 2
8 - 3
11 - 1
我将如何为此编写查询?