界面元素查询语句计算页数SQL中增加汇总值描述
2016-02-08 10:37
696 查看
界面如下图展示效果:请进入西安企云基创软件
SQL语句写法如下:
selectceiling(count(*)/10.0),'ROOT=【Number:'+STR(COUNT(*))
+'】 【Import
ct.:'+(cast(sum(FirstInStorageWeight)asvarchar(30)))
+'】 【Estimate
ct.:'+(cast(sum(EstimateWeight)asvarchar(30)))
+'】 【Current
ct.:'+(cast(sum(CurrentWeight)asvarchar(30)))+'】'
from (selectx.RecordID,x.DiamondID,x.OriginalWeight,x.FirstInStorageWeight,x.EstimateWeight,x.CurrentWeight
from DiamondDB.dbo.DiamondStock x
left joinDiamondDB.dbo.DiamondQuality y on x.Quality=y.QualityID
left joinDiamondDB.dbo.DiamondShape z on x.Shape=z.ShapeID
left joinDiamondDB.dbo.DiamondClarity a on x.Clarity=a.ClarityID
left joinDiamondDB.dbo.DiamondColor b on x.Color=b.ColorID
left joinDiamondDB.dbo.DiamondSymmetry d on x.Symmetry=d.SymmetryID
left joinDiamondDB.dbo.DiamondFluorescence f on x.Fluorescence=f.FluorescenceID
left joinDiamondDB.dbo.OriginalDiamondInStorageDetails o on x.DiamondID=o.DiamondID
left joinDiamondDB.dbo.ImportListMaster p on o.ListID=p.ListID ando.SerialNumber=p.SerialNumber
left joinDiamondDB.dbo.Supplier q on p.SupplierID=q.SupplierID
left joinDiamondDb.dbo.ProcessInfo u on x.ProcessID=u.ProcessID
left joinDiamondDB.dbo.ProcessType v on u.TypeID=v.TypeID
left joinDiamondPlatformDB.dbo.T_Employee te on x.EmpID=te.EmpID
left joinDiamondPlatformDB.dbo.T_Department td on te.DepID=td.DepID
where x.DiamondID=@Diamond_ and x.PackageNumber like '%'+@PackageNumber_+'%'and x.Shape=@shpeid_ and x.Color=@colorid_
andx.Clarity=@clarityid_ and x.Symmetry=@symmetryid_ andx.Fluorescence=@fluorescenceid_ and x.Quality=@qualityid_
andx.FirstInStorageWeight between @num1_ and @num2_ andx.ProcessStatus=@ProcessStatus_ and x.StorageStatus=@StorageStatus_
and o.ListID like'%'+@ListID_+'%' and o.SerialNumber like '%'+@SerialNumber_+'%' andx.IsFM=@IsFM_ and x.IsUrgent=@IsUrgent_
andq.SupplierID=@SupplierID_ and td.DepID=@DepID_ and te.EmpID=@EmpID_) t;
界面如下图展示效果:请进入西安企云基创软件
SQL语句写法如下:
selectceiling(count(*)/10.0),'ROOT=【Number:'+STR(COUNT(*))
+'】 【Import
ct.:'+(cast(sum(FirstInStorageWeight)asvarchar(30)))
+'】 【Estimate
ct.:'+(cast(sum(EstimateWeight)asvarchar(30)))
+'】 【Current
ct.:'+(cast(sum(CurrentWeight)asvarchar(30)))+'】'
from (selectx.RecordID,x.DiamondID,x.OriginalWeight,x.FirstInStorageWeight,x.EstimateWeight,x.CurrentWeight
from DiamondDB.dbo.DiamondStock x
left joinDiamondDB.dbo.DiamondQuality y on x.Quality=y.QualityID
left joinDiamondDB.dbo.DiamondShape z on x.Shape=z.ShapeID
left joinDiamondDB.dbo.DiamondClarity a on x.Clarity=a.ClarityID
left joinDiamondDB.dbo.DiamondColor b on x.Color=b.ColorID
left joinDiamondDB.dbo.DiamondSymmetry d on x.Symmetry=d.SymmetryID
left joinDiamondDB.dbo.DiamondFluorescence f on x.Fluorescence=f.FluorescenceID
left joinDiamondDB.dbo.OriginalDiamondInStorageDetails o on x.DiamondID=o.DiamondID
left joinDiamondDB.dbo.ImportListMaster p on o.ListID=p.ListID ando.SerialNumber=p.SerialNumber
left joinDiamondDB.dbo.Supplier q on p.SupplierID=q.SupplierID
left joinDiamondDb.dbo.ProcessInfo u on x.ProcessID=u.ProcessID
left joinDiamondDB.dbo.ProcessType v on u.TypeID=v.TypeID
left joinDiamondPlatformDB.dbo.T_Employee te on x.EmpID=te.EmpID
left joinDiamondPlatformDB.dbo.T_Department td on te.DepID=td.DepID
where x.DiamondID=@Diamond_ and x.PackageNumber like '%'+@PackageNumber_+'%'and x.Shape=@shpeid_ and x.Color=@colorid_
andx.Clarity=@clarityid_ and x.Symmetry=@symmetryid_ andx.Fluorescence=@fluorescenceid_ and x.Quality=@qualityid_
andx.FirstInStorageWeight between @num1_ and @num2_ andx.ProcessStatus=@ProcessStatus_ and x.StorageStatus=@StorageStatus_
and o.ListID like'%'+@ListID_+'%' and o.SerialNumber like '%'+@SerialNumber_+'%' andx.IsFM=@IsFM_ and x.IsUrgent=@IsUrgent_
andq.SupplierID=@SupplierID_ and td.DepID=@DepID_ and te.EmpID=@EmpID_) t;
相关文章推荐
- SQL1224N db2
- DButils工具类能够用来获取数据库连接向数据库插入更新删除对象2
- MySQL数据库触发器(trigger)
- Atitit.跨语言数据库db api兼容性 jdbc odbc ado oledb 增强方案
- Atitit.跨语言数据库db api兼容性 jdbc odbc ado oledb 增强方案
- Atitit.跨语言数据库db api兼容性 jdbc odbc ado oledb 增强方案
- 创建mysql数据表基础操作
- mysql基础指令和数据库基本操作
- could not open parameter file '/u01/app/oracle/product/11.1.0/db_1/dbs/initorc11g.ora
- 《MySQL必知必会》读书笔记(四) 22~30章 完结篇
- C++自制Redis数据库(五) 设计开始 敲定各模块架构--数据库模块
- Oracle学习第一天
- redis源码分析(1)----字符串sds
- mysql benchmark基准测试
- (绝对有用,而且实用)数据库存储,使用FMDB进行数据库操作
- spymemcached和spring的整合
- Table 'performance_schema.session_variables' doesn't exist
- C++自制Redis数据库(三)设计开始敲定各模块架构-简单集群设计
- oracle切割字符串后以单列多行展示
- SQL server语句练习