sql server查询一条数据如果这条数据不存在怎么给这一行数据赋上0_百 ...
发布网友
发布时间:2024-06-01 20:49
我来回答
共5个回答
热心网友
时间:2024-07-14 21:38
select top 1 I1,sum(RunTime) as RunTime
from
(select I1,0 from PDS_RunDaily
union all
select I1,sum(RunTime) as RunTime from PDS_RunDaily where I1 = '104' and MillID=10 and InsertTime between '2013-11-23' and '2013-11-24' group by I1) t
group by I1
热心网友
时间:2024-07-14 21:43
select count(1) from biao where id=12345
热心网友
时间:2024-07-14 21:42
select nvl(id,0) from table
热心网友
时间:2024-07-14 21:36
case when column is null then 0 end
或者
nvl(column,0)
热心网友
时间:2024-07-14 21:43
用 isnull
select isnull(productid,0) as pid form tablename where typeid=0