SQL如何把查询出来的记录保留整数
我字段类型 是INT类型的 可是这样一查出来
select '数量' as [BNAME],sum(case when day(OQCTime)=1 then Inspection else 0 end) as [1], 。。。。sum(case when day(OQCTime)=31 then Inspection else 0 end) as [31]from TB
select '数量' as [BNAME],ltrim(sum(case when day(OQCTime)=1 then floor(Inspection) else 0 end)) as [1],ltrim(sum(case when day(OQCTime)=31 then floor(Inspection) else 0 end)) as [31]from TB WHERE ....union allselect 'WPP' as [BNAME],ltrim(sum(case when day(OQCTime)=1 then WPP else 0 end)) as [1],...ltrim(sum(case when day(OQCTime)=31 then WPP else 0 end)) as [31]from TB WHERE ....
[解决办法]
--原理上就是这样的select ltrim(1) union allselect ltrim(4.5555)/*14.5555*/