我想要做的就是查找一个值并在子查询中返回
select
(select top 1 c.Type from ChangeTypes c where c.TypeID = r.ChangeType) as ChangeType,
COUNT(r.requestId) as RequestCount
from Request r
group by ChangeType
我不能让这个为我的生活工作......
非常感谢任何帮助!
答案 0 :(得分:0)
尝试与
类似的内容select
(select c.Type
from ChangeTypes c
where c.Type.Id = r.ChangeType.Id) as rtypes,
count(r.Requests) as rcount
from Request r
group by rtypes