现在的位置: 首页 > 综合 > 正文

Oracle,sql server的空值(null)判断

2013年08月25日 ⁄ 综合 ⁄ 共 592字 ⁄ 字号 评论关闭
Oracle,sql server的空值(null)判断

sql server

替换null:isnull(arg,value)

如:select isnull(price,0.0) from orders                             ,如果price为null的话,用0.0替换

 

null比较:  is not null,is null

 如  select * from orders where price is null                      ,price等于null

如: select * from orders where price is not null                  ,  price不等于null

 

Oracle

替换nullnvl(arg,value)

如: select  nvl(price,0.0) form orders

null比较:  is not null,is null

 如  select * from orders where price is null                      ,price等于null

如: select * from orders where price is not null                  ,  price不等于null

 

抱歉!评论已关闭.