Oracle与SQL Server SQL 判断处理null值方法

sql server

1.替换null:isnull(arg,value)

如:select isnull(price,0.0) from orders

2.与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

1.替换null: nvl(arg,value)

如: select nvl(price,0.0) form orders

2.与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

------------------------------------------------------------------------------------------------------------------------------------------------

posted @ 2016-01-14 13:55  刘竹青  阅读(352)  评论(0编辑  收藏  举报