|
本帖最后由 cdyis 于 2013-4-29 15:55 编辑
select gjmc,sxmc,hs,dw,gcl,groupnum from (
select gjmc,SXMC,iif(len(hsjss)=0,'',left(HSJSS,len(HSJSS)-1)) as hs,dw,sum(SXVAL) as gcl, GroupNum, inn.CompIndex
from [].CompDetailTemp as gj left join ObjClass as inn on gj.gjmc=inn.ClassName
where sxval<>0 and becheck=1 and sxmc<>'有梁板体积组合(m3)' and methodsign=0
group by gjmc,sxmc,iif(len(hsjss)=0,'',left(HSJSS,len(HSJSS)-1)),dw,inn.CompIndex, GroupNum
union all
select '梁, 板' as gjmc, sxmc,iif(len(hsjss)=0,'',left(HSJSS,len(HSJSS)-1)) as hs,
dw,sum(sxval) as gcl, groupnum, 230 as compindex
from [].CompDetailTemp
where sxval<>0 and becheck=1 and SXMC='有梁板体积组合 (m3)' and methodsign=0
group by sxmc,iif(len(hsjss)=0,'',left(HSJSS,len(HSJSS)-1)),dw,GroupNum )
order by groupnum, compindex, sxmc, hs
我想在统计字段gcl输出时乘以98%,求教。
|
|