这可能是一个简单的,但我无法理解它。
我有一个 MemberBusinessCats 表,其中包含一个 BusinessCatID 和一个 MemberID.. 该表可以像这样呈现:
+-----------------------+-----------------+------------+
| MemberBusinessCatID | BusinessCatID | MemberID |
+-----------------------+-----------------+------------+
| 27 | 45 | 102 |
+-----------------------+-----------------+------------+
| 28 | 55 | 102 |
+-----------------------+-----------------+------------+
| 29 | 61 | 102 |
+-----------------------+-----------------+------------+
| 30 | 45 | 33 |
+-----------------------+-----------------+------------+
| 31 | 23 | 33 |
+-----------------------+-----------------+------------+
| 32 | 45 | 73 |
+-----------------------+-----------------+------------+
| 32 | 61 | 73 |
+-----------------------+-----------------+------------+
| 32 | 45 | 73 |
+-----------------------+-----------------+------------+
如何制作脚本以显示以下数据
+-----------------+---------------------+
| BusinessCatID | NumMembers In Cat |
+-----------------+---------------------+
| 45 | 3 |
+-----------------+---------------------+
| 55 | 1 |
+-----------------+---------------------+
| 61 | 2 |
+-----------------+---------------------+
| 23 | 1 |
+-----------------+---------------------+
提前谢谢了。
新杰克