摘要: /** * 根据输入的字符串计算出其长度,支持中文和全角字符 * @param str * @return */ public static Integer length(String str){ char[] chars_ss = str.toCharArray(); Integer StringLe... 阅读全文
posted @ 2018-09-29 17:18 chenzechao 阅读(266) 评论(0) 推荐(0)
摘要: -- 多个值取最大和最小 select least(1,2,3,0,4,5) as min,greatest(1,2,3,0,4,5) as max; +------+------+--+ | min | max | +------+------+--+ | 0 | 5 | +------+------+--+ select coalesce(null,nul... 阅读全文
posted @ 2018-09-29 16:52 chenzechao 阅读(869) 评论(0) 推荐(0)
摘要: -- 指定时间增加带小数的天数 select day ,add_date_num ,cast(cast(day as bigint) + add_date_num * 24 * 60 * 60 as timestamp) as timestamp_new from ( select cast('2018-01-01' as timestamp) as da... 阅读全文
posted @ 2018-09-29 16:51 chenzechao 阅读(249) 评论(0) 推荐(0)