【发布时间】:2018-08-31 08:57:52
【问题描述】:
我有这个(SQL)表:
dataId userId type
104 1 customer
105 5 interessted
现在我想要一个查询来为每个用户获取每种类型存在多少条目。
例如,如果用户 ID 为 10 的用户有 10 个类型为“customer”的条目和 5 个类型为“interressted”的条目。
userID customers interrested
10 10 5
我该怎么做?
【问题讨论】: