我正在尝试进行子选择查询,但我的组中有 Null 值
SELECT convert(varchar, dbo.ArretProductionJournee.DateArret, 3) ,
(select
sum (datediff(minute, ArretProductionJournee.HeureDebut, ArretProductionJournee.HeureFin) )
where ArretProductionJournee.EnumArret Like 'HH')
as HH,
(select
sum (datediff(minute, ArretProductionJournee.HeureDebut, ArretProductionJournee.HeureFin) )
where ArretProductionJournee.EnumArret Like 'HI')
as HI,
(select
sum (datediff(minute, ArretProductionJournee.HeureDebut, ArretProductionJournee.HeureFin) )
where ArretProductionJournee.EnumArret Like 'PS')
as PS
FROM
dbo.ArretProductionJournee
where dbo.ArretProductionJournee.DateArret BETWEEN '01/04/2021'and '03/04/2021'
group by ArretProductionJournee.EnumArret, convert(varchar, dbo.ArretProductionJournee.DateArret, 3)
结果如下:
我想删除那些 Null 值以获得如下结果:
---------------------------
Date Arrêt | HH | HI | PS |
---------------------------
03 / 02/ 21| 0 | 29 | 45 |