当前位置:你问我答 >  详情

求助:BMF2018版,帮忙看个语句。

Windows7
CAD2010

现有的表格样式和SQL语句:逻辑幢号,户编号,单元号,楼层,房号,建筑面积,套内面积,分摊面积,分摊系数,用途

SQL语句:SELECT right('0000'+shisLogicBuild.LogicBldNo,4) as ljzh,right('0000'+CAST ( p.RoomNo AS varchar ),4) as hh,P.Cellno,f.floorname,p.DoorNo,p.ARCHAREA,p.SETINAREA,p.APPAREA,AC.AppCoeff,p.USEPURPOSe
from  shisbuildinf b  
left join Shisproperty P  on p.buildingid=b.id left join shisappcoeff AC on p.AppcoeffID=AC.ID
left join shisfloors f on p.floorid=f.id
left join shiscells C on P.cellno = C.Cellno and C.Buildingid = P.buildingid inner join shisLogicBuild on shisLogicBuild.id=c.LogicBldid
where b.id =[BUILDID]  order by p.REROOMCODE


想将逻辑幢号改为幢号,单元号改为单元名,排序依据楼层、单元、房号进行排序,既改为如下表格样式:

幢号,户编号,单元名,楼层,房号,建筑面积,套内面积,分摊面积,分摊系数,用途


谢谢帮助!

全部评论

等级:LV28
积分:95013
南方数码蓉儿 2019-11-18 15:11

SELECT b.BldNo,right('0000'+CAST ( p.RoomNo AS varchar ),4) as hh,viewBmfRoom2.CellName,f.floorname,p.DoorNo,p.ARCHAREA,p.SETINAREA,p.APPAREA,AC.AppCoeff,p.USEPURPOSe

from  shisbuildinf b  

left join Shisproperty P  on p.buildingid=b.id left join shisappcoeff AC on p.AppcoeffID=AC.ID

left join shisfloors f on p.floorid=f.id

left join viewBmfRoom2  on P.ID = viewBmfRoom2.PROID and viewBmfRoom2.BLDID = P.buildingid

where b.id =[BUILDID] order by f.ID,P.Cellno,p.DoorNo

回复 2
zhusir谢谢蓉儿
2019-11-19 07:59:46

提交
悬赏回复规则
1、悬赏期为24小时,从发布时间起算;
2、悬赏期内提问者如设置评论为“精选评论”,视为悬赏结束,该精选评论人将获得本题全部悬赏积分;
3、悬赏期内如提问者未设置“精选评论”,则前5位评论者平分悬赏积分(如仅有一位评论,该评论者获得50%悬赏积分);
4、悬赏积分会自动发放到生态圈账户中,请留意站内信通知。
知道了

距离打开宝箱还剩7

是否花费200积分补签?
确认
取消