1653','1605','970','1604','1663','1609','1608','1624','1625'))  and ajjbxx.ndh*=
t_ajdjxx.ndh and ajjbxx.ajzh*=t_ajdjxx.ajzh and ajjbxx.ajbh*=t_ajdjxx.ajbh   ) a
s ajjbxx, (select pid,max(case when convert(int,b.jflb)=0 then s else 0 end ) as
 sumzl0,max(case when convert(int,b.jflb)=1 then s convert(int,b.jflb) else 0 en
d) as sumzl1, max(case when convert(int,b.jflb)=2 then s  else 0 end) as sumzl2,
max(case when convert(int,b.jflb)=3 then s else 0  end ) as sumzl3,max(case when
 convert(int,b.jflb)=4 then s else 0 end) as sumzl4,max(case when convert(int,b.
jflb)=5  then s else 0 end) as sumzl5,max(case when convert(int,b.jflb)=6 then s
 else 0 end ) as sumzl6,max(case when convert(int,b.jflb)=7  then  s   else  0 e
nd ) as sumzl7, max(case when convert(int,b.jflb)=8 then s else 0 end ) as sumzl
8,max(case when convert(int,b.jflb)=9 then s else 0 end ) as sumzl9, max(case wh
en  convert(int,b.jflb)=10 then s else 0 end ) as sumzl10,max(case  when  conver
t(int,b.jflb)=11 then s else 0 end ) as sumzl11,max(case when convert(int,b.jflb
)=12 then s else 0 end ) as sumzl12,max(case when convert(int,b.jflb)=13 then s
else 0 end) as sumzl13 from(select pid,jflb,sum(convert(int,jfje)) as s  FROM (s
elect * from t_ssfxx where flag <>'1' or flag is null) GROUP BY pid) as  b) as b
  where b.pid=*ajjbxx.id   Order By convert(numeric,(case when sign(charindex('-
'