上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 39 下一页
摘要: /** * 根据输入的字符串计算出其长度,支持中文和全角字符 * @param str * @return */ public static Integer length(String str){ char[] chars_ss = str.toCharArray(); Integer StringLe... 阅读全文
posted @ 2018-09-29 17:18 chenzechao 阅读(265) 评论(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)
摘要: dos2unix * for i in `ls` do id=`echo ${i:0:2}` awk '{print tolower($0)}' "${i}"|grep -Eiw "from"|awk -F 'from' '{print $NF}'|grep -v "("|awk -F'.' '{print $NF}'|awk -v id=${id} '{print id... 阅读全文
posted @ 2018-09-19 17:39 chenzechao 阅读(318) 评论(0) 推荐(0)
摘要: cat >b <<EOF line1 line2 line3 EOF # 方法1 while read line do echo ${line} done < <(cat b) # 方法2 cat b|while read line do echo ${line} done # 方法3 while read line do echo ${lin... 阅读全文
posted @ 2018-09-19 16:14 chenzechao 阅读(622) 评论(0) 推荐(0)
摘要: ref:https://blog.csdn.net/trigl/article/details/68944434 阅读全文
posted @ 2018-09-12 10:22 chenzechao 阅读(249) 评论(0) 推荐(0)
摘要: Oozie使用的时候有以下不便: [a]Oozie调度的Workflow只能使用XML文件配置 [b]启动调度只能通过命令行 [c]无法通过Oozie界面调试调度脚本 [d]Oozie无法可视化调试脚本时候 [e]无法分组,权限管理等 阅读全文
posted @ 2018-09-12 10:08 chenzechao 阅读(655) 评论(0) 推荐(0)
摘要: ### 提取SQL语句 FILE_PATH="/data/SCRIPT" cat tables | while read file do echo "-----> ${file}" start=`grep -nEi "^insert|^with" ${FILE_PATH}/${file}|awk -F':' '{print $1}'|head -1` end=$(... 阅读全文
posted @ 2018-09-05 11:39 chenzechao 阅读(331) 评论(0) 推荐(0)
摘要: select t1.owner ,t1.table_name ,t1.column_id ,t1.column_name ,t1.data_type ,t2.comments from all_tab_columns t1 join all_col_comments t2 on t1.owner = t2.owner ... 阅读全文
posted @ 2018-08-31 14:33 chenzechao 阅读(237) 评论(0) 推荐(0)
摘要: 1 -- 当年/月/日累计指标数据初始化 2 with data_day as ( 3 select 'a' name,'2016-07-01' as day, 1 as value union all 4 select 'a' name,'2017-07-01' as day, 2 as value union all 5 select 'a' nam... 阅读全文
posted @ 2018-08-29 13:53 chenzechao 阅读(356) 评论(0) 推荐(0)
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 39 下一页