随笔分类 -  oracle

sql查询记录
摘要:SQL写法: begin update table_name set salary = 10000 where emp_id = 5; if sql%notfound then insert into table_name (id,name,salary)values("","","") ; end 阅读全文
posted @ 2019-04-25 14:43 L缘OV分E 阅读(4908) 评论(2) 推荐(0)
摘要:oracle在使用函数计算式会遇到这样的情况:例如sum函数 如果计算的sum值为null,则用0替代 方法1(便于理解): select when sum(c.num) is null then 0 else sum(t.num) from class c 方法2(简单粗暴): NVL(Expr1 阅读全文
posted @ 2019-04-24 19:18 L缘OV分E 阅读(1992) 评论(0) 推荐(0)