- 博客(17)
- 收藏
- 关注
原创 python连接oracle报错DPI-1047
python使用cx_Oracle连接oracle报错:cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library
2022-10-11 18:44:18
3330
1
转载 git下载项目到本地
1.新建一个目录,存放下载下来的项目,我在D盘新建了一个“gitcode”文件夹,用来存放下载下来的项目2.进入刚刚新建的文件夹,即进入“gitcode”,点击鼠标右键,选择"Git Bash Here"3.进行基础配置,作为 git 的基础配置,作用是告诉 git 你是谁,你输入的信息将出现在你创建的提交中,使用下面两条命令:git config --global user.name “你的名字或昵称”git config --global user.email “你的邮箱”4.初始化命令gi
2021-11-22 14:52:52
11027
原创 hive拼接函数,行转列与列转行
拼接函数1.concat命令格式:concat(string A, string B...)参数说明:● A,B等为string类型,若输入为bigint, double, datetime类型会隐式转换为string后参与运算,其它类型报异常。返回值:string用途:返回值是将参数中的所有字符串连接在一起的结果。备注:如果没有参数或者某个参数为NULL,结果均返回NULLconcat(), concat(null, 'a'), concat('a', null, 'b')返回值
2021-08-13 12:10:32
1352
原创 连续3天登陆,最大连续登陆时间
第一步将日期连续的归到同一个dateselect *,calendar_date-rn as date_groupfrom (select *,row_number() over(PARTITION by auid order by calendar_date) as rn from (select calendar_date,auid from test.test_11 group by calendar_date,auid) a )b第二步..
2021-07-05 20:33:01
143
转载 cron: airflow 运行周期设置 schedule_interval
cron# ┌───────────── minute (0 - 59)# │ ┌───────────── hour (0 - 23)# │ │ ┌───────────── day of the month (1 - 31)# │ │ │ ┌───────────── month (1 - 12)# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;# │ │ │ │ │ .
2021-03-05 10:21:17
7984
1
原创 字段截取
1.split_partSPLIT_PART ( string , delimiter , field )select word ,split_part(word,'-',1) as part1 ,split_part(word,'-',2) as part2 ,left(word,5) as left_word ,right(word,4) as right_word ,substr(word,6,4) as su
2020-09-04 18:16:10
309
原创 开窗函数之LAG,LEAD与自连接
LAG与LEAD返回窗口中当前行之前(之后)给定偏移量的输入表达式的值,即在同一张表中实现错位查询。它可以避免消耗更大的自连接,从而提高查询处理速度。函数写法:LAG ( expression[, offset ] [, default ] ) OVER ( partition by... order by... )expression:字段名;offset:偏移量,上(下)1行或N行;default:函数取上N/下N个值,当在表中从当前行位置向前数N行已经超出了表的范围时,defa
2020-09-04 16:28:20
3605
原创 开窗函数
1.排名:ROW_NUMBER(),RANK(),DENSE_RANK()SELECT employee_region region, employee_key, annual_salary, ROW_NUMBER() OVER (PARTITION BY employee_region ORDER BY annual_salary) 'Row Number'RANK() OVER ...
2020-04-02 15:08:35
174
原创 分组汇总之ROLLUP与CUBE
1.ROLLUP()SELECT Category, Year, SUM(Amount) FROM expenses GROUP BY ROLLUP(Category, Year) ORDER BY 1,2, GROUPING_ID(); Category | Year | SUM-------------+------+-------- Books | 2...
2020-03-31 12:16:08
111
原创 ifnull与nvl
1.ifnullIFNULL ( expression1 , expression2 );表达式1为null,返回表达式2;表达式1不为null,则返回表达式1。SELECT IFNULL (SCORE, 0.0) FROM TESTING; IFNULL-------- 100.0 87.0 .0 .0 .0(5 rows)2....
2019-11-01 18:26:15
1469
原创 decode
DECODE ( expression, search, result [ , search, result ]...[, default ] )DECODEis similar to the IF-THEN-ELSE andCASEexpressions:CASE expression[WHEN search THEN result][WHEN search THEN res...
2019-11-01 18:08:08
536
原创 数据类型转换之to_char,to_date,cast
to_char,to_datedate_key为int,不能直接转化成date,需先转化为char或varcharto_date(to_char(max(date_key)),'yyyymmdd')to_date(max(date_key)::varchar,'yyyymmdd')castto_date(cast(max(date_key) as varchar)...
2019-11-01 17:31:32
826
原创 深入理解LEFT JOIN
a表,b表如下SQL执行顺序,先执行join,得到一个join的组合结果,然后执行where,where对join的整体结果进行过滤。left join的执行结果:select a.account_id as a_account_id ,a.channel as a_channel ,b.account_id as b_account_id...
2019-09-16 10:17:43
2142
转载 SQL语句执行顺序
sql执行顺序(1)from(3) join(2) on(4) where(5)group by(6) avg,sum....(7)having (唯一应用到已分组数据的筛选器)(8) select(9) distinct(10) order by(可使用select中的别名)(11) limit从这个顺序中我们不难发现,所有的 查询语句都是从fro...
2019-09-12 18:04:25
119
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人