问题起因:
这几天通过视图创建了一个复杂的多表查询,但在执行查询事后总是报(未能为视图或函数解释分析分配辅助表,超过了查询中表地最大数目(260)--)这个异常。
我的查询SQL脚本如下:
select T1.当前处理人帐号,T1.当前处理人姓名,T1.当前处理人岗位,T1.当前处理人部门,T1.未关闭问题数,
(case when T2.待处理 is null then 0 else T2.待处理 end) as
待处理,(case when T3.需求处理中 is null then 0 else T3.需求处理中 end) as
需求处理中,(case when T4.修改中 is null then 0 else T4.修改中 end) as 修改中,
(case when T5.待验证 is null then 0 else T5.待验证 end) as 待验证,(case when T7.替换文件待验证
is null then 0 else T7.替换文件待验证 end) as 替换文件待验证,(case when T6.待构造
is null then 0 else T6.待构造 end) as 待构造 from(
(select 当前处理人帐号,当前处理人姓名,当前处理人岗位,当前处理人部门,count(id) as 未关闭问题数
from V_ZCW_CurrentDeptAndProduct_CurrUser
where state <>'已关闭' AND (当前处理人岗位
in ('开发','测试','设计','管理','需求','产品管理','开发管理','支持','实施','市场')) group by
当前处理人帐号,当前处理人姓名,当前处理人岗位,当前处理人部门 ) T1 left outer join
(select 当前处理人帐号,count(id) as 待处理 from V_ZCW_CurrentDeptAndProduct_CurrUser
where state ='待处理' AND (当前处理人岗位
in ('开发','测试','设计','管理','需求','产品管理','开发管理','支持','实施','市场'))
group by 当前处理人帐号 ) T2 on T1.当前处理人帐号=T2.当前处理人帐号
left outer join (select 当前处理人帐号,count(id) as 需求处理中 from V_ZCW_CurrentDeptAndProduct_CurrUser
where state ='需求处理中' AND (当前处理人岗位 in
('开发','测试',