select top 2000 BuildingNo, rt.StdCode as Meterusetype, brbhth.LineType,UseType,DADay,DAHour,SumQty,Lable
from BuildingReportByHourTypeH brbhth
left join (select CodeId,StdCode from CodeDetail where CodeGroupNo='MeterUseType') as rt on brbhth.LineType=rt.CodeId
where brbhth.LineType is not null
这里的brbhth.LineType is not null 没起作用啊,查出来的结果集还有为nul来的,怎么回事???
and Lable=0 and UseType in ('EM','WM') and BuildingNo in
( select BuildingNo from Building where UploadFlag=0)
and brbhth.DADay>'20140000' and brbhth.LineType!='All' and brbhth.LineType!='*'
order by DADay asc,DAHour asc