我已经广泛搜索了这个网站,但找不到解决方案。
这是我的查询示例:
SELECT
ActivityID,
Hours = (CASE
WHEN ActivityTypeID <> 2 THEN
FieldName = (Some Aggregate Sub Query),
FieldName2 = (Some other aggregate sub query)
WHEN ActivityTypeID = 2 THEN
FieldName = (Some Aggregate Sub Query with diff result),
FieldName2 = (Some Other Aggregate Sub Query with diff result)
END)
显然我遗漏了很多查询,我只是想看看它是否可能。
我知道我可能只能做两次“案例”,但我想我会问......