当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Ovie map computer terminal and mobile terminal can not be used, is there any alternative map tool
选择黑盒测试用例设计方法的综合策略方案总结
SQL Server2000 各个版本之间的区别
常用SQL server语句
Difference: char* and char[]
小程序/app触底加载更多数据
Anaconda4.8.3介绍、安装及使用教程安装(win10)并修改Jupyter默认工作目录
JS报错-Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on...
Redis high availability
本体开发日记03-理解代码
MySQL索引
Ontology Development Diary 01-Jena Configuration Environment Variables
Amplify Shader Editor手册 Unity ASE(中文版)
功能自动化测试实施的原则以及方法有哪些?
进入大厂的面试经验(P7)
MySQL Checking and Filling Leaks (5) Unfamiliar Knowledge Points
无符号整数文法和浮点数文法
div模拟textarea文本框,输入文字高度自适应,且实现字数统计和限制
canal工作原理及简单案例演示
TypeScript简记(一)