全部评论
SELECT b.cm,b.qsc,b.zzc,b.cs FROM (SELECT f.FloorName cm,f.FloorNO qsc,f.FloorNO zzc,a.cs FROM dbo.shisFloors f JOIN
(SELECT COUNT(*) AS cs,SameFlrID FROM dbo.shisFloors WHERE BuildingID={BUILDID}
GROUP BY SameFlrID) a ON a.SameFlrID = f.SameFlrID WHERE a.cs=1
UNION
SELECT MIN(f.FloorName)+'至'+MAX(f.FloorName),MIN(f.FloorNO),MAX(f.FloorNO),a.cs FROM dbo.shisFloors f JOIN
GROUP BY SameFlrID) a ON a.SameFlrID = f.SameFlrID WHERE a.cs !=1 GROUP BY a.cs) b ORDER BY qsc ASC
报表出不来呢
距离打开宝箱还剩7天
全部评论