当前位置:网站首页>PSQL column to row
PSQL column to row
2022-06-25 02:27:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
demand
Student transcript
- Create table initialization
CREATE TABLE public.test ( name VARCHAR(20), score FLOAT, total_availability FLOAT, shelf_availability FLOAT );
INSERT INTO public.test (name, score, total_availability, shelf_availability) VALUES ('A', 1, 1.1, 1.2);
INSERT INTO public.test (name, score, total_availability, shelf_availability) VALUES ('B', 3, 2.1, 2.2);
INSERT INTO public.test (name, score, total_availability, shelf_availability) VALUES ('C', 6, 3.3, 3.4);
INSERT INTO public.test (name, score, total_availability, shelf_availability) VALUES ('D', 10, 4.1, 4.2);
SELECT * FROM public.test;- Transfer line column
SELECT name, score, unnest(ARRAY ['total_availability' :: TEXT, 'shelf_availability' :: TEXT]) AS kpi_details, unnest( ARRAY [public.test.total_availability :: NUMERIC(30, 16), public.test.shelf_availability :: NUMERIC(30, 16)]) AS value FROM public.test;Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/151771.html Link to the original text :https://javaforall.cn
边栏推荐
猜你喜欢

【直播回顾】战码先锋第七期:三方应用开发者如何为开源做贡献

Experience of epidemic prevention and control, home office and online teaching | community essay solicitation

Sumati gamefi ecological overview, element design in the magical world

Random list random generation of non repeating numbers

华为、阿里等大厂程序员真的好找对象吗?

DDD concept is complex and difficult to understand. How to design code implementation model in practice?

常用的软件测试工具清单,请查收。

yarn : 无法加载文件 C:\Users\xxx\AppData\Roaming\npm\yarn.ps1,因为在此系统上禁止运行脚本

分布式事务解决方案和代码落地

It is said that Yijia will soon update the product line of TWS earplugs, smart watches and bracelets
随机推荐
MOS tube related knowledge
LINQ 查询(3)
Viewing MySQL password on Linux_ MySQL forgets password "suggestions collection" under Linux
Once beego failed to find bee after passing the go get command Exe's pit
linux上查看mysql的密码_Linux下MySQL忘记密码「建议收藏」
ProcessOn制作ER过程(自定义)
MCN机构遍地开花:博主和作者要谨慎签约、行业水很深
|How to analyze bugs? Professional summary and analysis
当一个接口出现异常时候,你是如何分析异常的?
Using qdomdocument to manipulate XML files in QT
Redistemplate operates redis. This article is enough (I) [easy to understand]
The ecosystem of the yuan universe
random list随机生成不重复数
Logminer database log mining
实战攻防演练中的四大特点
疫情防控,居家办公,网上授课之心得 | 社区征文
元宇宙的生态圈
vim的Dirvish中文文档
Lizuofan, co-founder of nonconvex: Taking quantification as his lifelong career
测试/开发程序员,30而立,你是否觉得迷茫?又当何去何从......