当前位置:网站首页>Another implementation of lateral view explode
Another implementation of lateral view explode
2022-08-09 09:22:00 【research monk who doesn't like research】
Lateral view explode results:
If you don't use lateral view explode, you can do it like this:
Steps:
1. Turn one record into n identical records, ie
Put the serial number value in front, num is the key, answers[num] is the desired value,
2. The implementation of the above figure is achieved by connecting two tables,
The implementation of 3.B table is to generate incremental numbers, use space to get n spaces, and add serial numbers before the corresponding spaces
--Method 1selectrow_number() over() as idfrom(select split(space(299), ' ') as x) tlateral view explode(x) ex;--Method 2select pos + 1from(select 1 as id_start, 300 as id_end) tlateral view posexplode(split(space(id_end - id_start), ' ')) ex as pos, blank;
posexplode(array) t as pos, blank, only the first field has a value, which is the position, the second is empty, if it is a map, there is a value
边栏推荐
- 第四讲 SVN
- 微信小程序转支付宝小程序注意事项
- MySQL Leak Detection and Filling (3) Calculated Fields
- Venture DAO Industry Research Report: Macro and Classic Case Analysis, Model Summary, Future Suggestions
- Failed to mount component: template or render function not defined.
- 进入大厂的面试经验(P7)
- 年薪40W测试工程师成长之路,你在哪个阶段?
- 无符号整数文法和浮点数文法
- MySQL查漏补缺(二)排序检索、过滤数据、模糊查询、正则表达式
- 【培训课程专用】CA/TA调用模型-代码导读
猜你喜欢
测试计划包括哪些内容?目的和意义是什么?
Understanding of PID control motor output as motor PWM duty cycle input
支付宝小程序使用自定义组件(原生)
中国打造国产“谷歌地球”清晰度吓人
Amplify Shader Editor手册 Unity ASE(中文版)
Redis Basics
js在for循环中按照顺序响应请求
运行flutter项目时遇到的问题修改flutter为国内镜像
The era of Google Maps is over, how to view high-definition satellite image maps?
智慧图书馆的导航方案-定位导航导览-只用一个方案全部实现
随机推荐
MySQL transaction isolation
多维度LSTM(长短期记忆)神经网络预测未来存款余额走势
算术表达式求值演示
【培训课程专用】Secureboot
【环境搭建】onnx-tensorrt
JS报错-Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on...
本体开发日记05-努力理解SWRL(RDF Concrete Syntax)
Web请求原理
问卷问题和答案的合并
MVCC多版本并发控制
年薪40W测试工程师成长之路,你在哪个阶段?
无符号整数文法和浮点数文法
医院智能3D蓝牙导航导诊系统
关于链表的几道大厂面试题
软件测试个人求职简历该怎么写,模板在这里
MySQL event_single event_timed loop event
Redis high availability
本体开发日记01-Jena配置环境变量
Django实现对数据库数据增删改查(二)
小程序/app触底加载更多数据