![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQL
TinyNasubi
Only when you really know what you search for in your life, can you put you best effort in it!
展开
-
通过SQL实现账号余额的历史拉链操作
1. 题目在论坛看到的Oracle的SQL练习题,想到Hive也可以实现,就拿来试了一下~~2.思路可以通过分组函数 lead() over() 来取Start_dt 和End_dt3.解答1)建源表create table acctno_bal(Acctno bigint COMMENT ‘账号’,Current_bal int COMMENT ‘余额’,Txn_dt str...原创 2020-03-02 09:04:10 · 1798 阅读 · 0 评论 -
SQL 函数 instr的用法
SQL 函数 instr的用法转自: http://blog.sina.com.cn/s/blog_6094cbf30100frz0.htmlINSTR(C1,C2,I,J) 在一个字符串中搜索指定的字符,返回发现指定的字符的位置;C1 被搜索的字符串C2 希望搜索的字符串I 搜索的开始位置,默认为1J 出现的位置,默认为1SQL>select instr...转载 2019-10-23 16:42:23 · 3131 阅读 · 0 评论