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,Expr2)如果Expr1为NULL,返回Expr2的值,否则返回Expr1的值 select NVL(SUM(c.num) ,0) from class c
CAS (15) - CAS 线上环境 Ehcache Replication 的非稳定重现错误 摘要 线上环境在 EhCache Replication 过程中出现 java.util.ConcurrentModificationException 2016-12-21 14:58:02,022 ERROR [net.sf.ehcache.distribution.RMISynchronousCacheReplicator] - <Exception on replication of put
原文(http://www.cnblogs.com/ldp615/archive/2011/12/11/2284154.html) Linq 出现之前,我们通常使用下面的方式来判断集合是否非空,即集合包含元素: ]; ; var list = new List<string>(); ; var collection = new Collection<double>(); ; 使用 Length 或 Count 属性,上面的写法没有问题. 但到了 Linq 时代,Enumerable
Linq 出现之前,我们通常使用下面的方式来判断集合是否非空,即集合包含元素: ]; ; var list = new List<string>(); ; var collection = new Collection<double>(); ; 使用 Length 或 Count 属性,上面的写法没有问题. 但到了 Linq 时代,Enumerable.Count 扩展方法“统一了“ Length 和 Count 属性,于是就有了下面判断非空的写法: public static v
1.字符串参与判断时:非空即为真判断字符串为空的方法if(str!=null && str!=undefined && str !='')可简写为if(!str){ console.log(str)}2.数字参与if判断:非0非NAN即为真 var i = 0;if(i){ alert('here');}else{ alert('test is ok!');} 输出结果为here var i = 0;if(i){ alert('here');}else{ alert(
mysql count(0) count(*) count(主键) count(非空字段) 效率比较 写代码的时候经理在背后说了一句count(0)的效率高于count(*) ,索性全部测试了一下 结论:1.count(0)效率等于count(*)等于count(主键)等于count(非空字段) 但是 唯一的区别就是count只会统计非空字段 系统配置 processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 85 model n