exec FLX_PLATFORM_PAGING_STATISTIC @QueryStr=N'
Select top 100 percent LA0110 as [专家类别],AA0107 as [性别],A0405R03 as [学历],
(select count(LA0106) From
View_LA01_LE01_20090209 as t where 1=1 and (View_LA01_LE01_20090209.LA0110= t.LA0110 and View_LA01_LE01_20090209.AA0107= t.AA0107 and
View_LA01_LE01_20090209.A0405R03= t.A0405R03
and ( (LA0110 = ''01'' or LA0110 = ''02'' or LA0110 = ''经济技术类'' or LA0110 = ''科教文卫类'' )
and PersonName = ''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 = ''1111111'' ))) as [来华许可证],
(select count(LA0175) From View_LA01_LE01_20090209 as t where 1=1 and
(View_LA01_LE01_20090209.LA0110= t.LA0110 and View_LA01_LE01_20090209.AA0107= t.AA0107 and View_LA01_LE01_20090209.A0405R03= t.A0405R03 and ( (LA0110 = ''01'' or
LA0110 = ''02'' or LA0110 = ''经济技术类'' or LA0110 = ''科教文卫类'' ) and PersonName = ''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 = ''1111111'' ))) as
[外专证],
(select count(LA0110) From View_LA01_LE01_20090209 as t where t.LA0110=''01'' and (View_LA01_LE01_20090209.LA0110= t.LA0110 and
View_LA01_LE01_20090209.AA0107= t.AA0107 and View_LA01_LE01_20090209.A0405R03= t.A0405R03 and ( (LA0110 = ''01'' or LA0110 = ''02'' or LA0110 = ''经济技术类'' or
LA0110 = ''科教文卫类'' ) and PersonName = ''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 = ''1111111'' ))) as [经济技术类],
(select count(LA0110) From
View_LA01_LE01_20090209 as t where t.LA0110=''02'' and (View_LA01_LE01_20090209.LA0110= t.LA0110 and View_LA01_LE01_20090209.AA0107= t.AA0107 and
View_LA01_LE01_20090209.A0405R03= t.A0405R03 and ( (LA0110 = ''01'' or LA0110 = ''02'' or LA0110 = ''经济技术类'' or LA0110 = ''科教文卫类'' ) and PersonName =
''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 = ''1111111'' ))) as [科教文卫类]
from View_LA01_LE01_20090209 where (LA0110 = ''01'' or LA0110 = ''02'' or LA0110
= ''经济技术类'' or LA0110 = ''科教文卫类'' ) and PersonName = ''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 = ''1111111'' group by
LA0110,AA0107,A0405R03',
@PageSize=10,@PageCurrent=1,
@FdShow=N'专家类别,性别,学历,[科教文卫类],[经济技术类],[外专证],[来华许可证]',
@FdOrder=N'专家类别,性别,学历',
@sql=N'
select count(*) as count from(Select top 100 percent LA0110 as [专家类别],AA0107 as [性别],A0405R03 as [学历],(select count(LA0106) From View_LA01_LE01_20090209 as t where
1=1 and (View_LA01_LE01_20090209.LA0110= t.LA0110 and View_LA01_LE01_20090209.AA0107= t.AA0107 and View_LA01_LE01_20090209.A0405R03= t.A0405R03 and
( (LA0110 = ''01'' or LA0110 = ''02'' or LA0110 = ''经济技术类'' or LA0110 = ''科教文卫类'' ) and PersonName = ''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 = ''1111111'' )))
as [来华许可证],
(select count(LA0175) From View_LA01_LE01_20090209 as t where 1=1 and (View_LA01_LE01_20090209.LA0110= t.LA0110 and View_LA01_LE01_20090209.AA0107=
t.AA0107 and View_LA01_LE01_20090209.A0405R03= t.A0405R03 and ( (LA0110 = ''01'' or LA0110 = ''02'' or LA0110 = ''经济技术类'' or LA0110 = ''科教文卫类'' ) and
PersonName = ''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 = ''1111111'' ))) as [外专证],
(select count(LA0110) From View_LA01_LE01_20090209 as t where
t.LA0110=''01'' and (View_LA01_LE01_20090209.LA0110= t.LA0110 and View_LA01_LE01_20090209.AA0107= t.AA0107 and View_LA01_LE01_20090209.A0405R03= t.A0405R03 and (
(LA0110 = ''01'' or LA0110 = ''02'' or LA0110 = ''经济技术类'' or LA0110 = ''科教文卫类'' ) and PersonName = ''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 =
''1111111'' ))) as [经济技术类],
(select count(LA0110) From View_LA01_LE01_20090209 as t where t.LA0110=''02'' and (View_LA01_LE01_20090209.LA0110= t.LA0110 and
View_LA01_LE01_20090209.AA0107= t.AA0107 and View_LA01_LE01_20090209.A0405R03= t.A0405R03 and ( (LA0110 = ''01'' or LA0110 = ''02'' or LA0110 = ''经济技术类'' or
LA0110 = ''科教文卫类'' ) and PersonName = ''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 = ''1111111'' ))) as [科教文卫类]
from View_LA01_LE01_20090209 where (LA0110 = ''01'' or LA0110 = ''02'' or LA0110 = ''经济技术类'' or LA0110 = ''科教文卫类'' ) and PersonName = ''AAAA'' and AA0111 = ''2009-03-20'' and LA0159 =
''1111111'' group by LA0110,AA0107,A0405R03) as temptable',
@getcount=0
同意楼上的回答。
这个看都没法看,别人怎么帮你呢,建议楼主将你要问的问题抽离出来,在最简单的情景下表达出来,这样别人才能尽量帮你。
代码太多了……