Hive HQL使用记录

inner join,join, left join, full join区别

  • inner join(内连接)【 join默认是inner join】

(等值连接) 只返回两个表中【联结字段相等的行】

  • left join(左联接)

返回包括【左表中所有记录】和右表中联结字段相等的记录

  • right join(右联接)

返回包括【右表中的所有记录】和【左表中联结字段相等】的记录

  • full join(全连接)

full join代表的是全连接:会将【主副表相对应的数据行查出】的同时, 将 T1表在T2表中没有对应的数据行与T2表在T1表中【没有对应的数据行尽数查出】,所以称为全连接查询.

⭐️excel/HQL 公式把时间戳转换成标准时间

=TEXT((单元格/1000+83600)/86400+70365+19,“yyyy-mm-dd hh:mm:ss”)

select *, from_unixtime(cast(CAST(st AS BIGINT)/1000 AS bigint), ‘yyyy/MM/dd HH:mm:ss’) as st2 from iyourcar_dw.stage_all_action_realtime_log where d=‘2020-01-06’ and ctype=2 and uid=‘3_57ea07370cf23177d929c83b’ order by st desc limit 100

发布了79 篇原创文章 · 获赞 14 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_38689232/article/details/103852104