sql问题


select
    CONVERT(varchar(12),BOMApprovedDateTime,23) as '工艺审核日期',
BOMApprovedBy as '工艺审核人',
sum(case SplitBOMType when 1 then 1 else 0 end) as '2020',
sum(case SplitBOMType when 2 then 1 else 0 end) as 'CAD转2020',
sum(case SplitBOMType when 3 then 1 else 0 end) as '手工拆单',
sum(case SplitBOMType when 4 then 1 else 0 end) as 'CAD转IMOS',
--sum(case isnull(DoorBomApprovedDateTime,BOMApprovedDateTime) when 0 then 1 else 0 end) as '门滑'
COUNT(id) as '汇总'
from dbo.C_Order
where CONVERT(varchar(12),BOMApprovedDateTime,23) ='2016-11-30'
group by CONVERT(varchar(12),BOMApprovedDateTime,23),BOMApprovedBy

--------------------------------------------------------------------------------------------------------------------
select  CONVERT(varchar(12),DoorBomApprovedDateTime,23) as '门审核日期',
  DoorBomApprovedBy as '门审核人',
  COUNT (DoorBomApprovedBy ) as '滑门'
from dbo.C_Order
where    CONVERT(varchar(12),DoorBomApprovedDateTime,23) ='2016-11-30'      
group by CONVERT(varchar(12),DoorBomApprovedDateTime,23),
   DoorBomApprovedBy
怎么把下一个查询添加到上一个查询中去成为一列?
FineReport何必管一片海 发布于 2017-1-3 16:21
回答问题
悬赏:2 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
hbyanghua发布于2017-1-3 16:21(编辑于 2023-9-6 09:34)
555
最佳回答
0
zsh331发布于2017-1-3 16:31(编辑于 2023-9-6 09:34)
555
  • 0关注人数
  • 544浏览人数
  • 最后回答于:2017-1-3 16:31
    活动推荐 更多
    热门课程 更多
    返回顶部