与此问题类似:是否有方法在prestodb cli中切换扩展表格式模式?。
有没有办法在配置单元中启用扩展表格式模式?在开始大查询作业之前,我想检查宽表中的一些记录。
从另一个问题复制示例:
展开表格格式之前:
select * from sometable;
id | time | humanize_time | value
----+-------+---------------------------------+-------
1 | 09:30 | Early Morning - (9.30 am) | 570
2 | 11:30 | Late Morning - (11.30 am) | 690
3 | 13:30 | Early Afternoon - (1.30pm) | 810
4 | 15:30 | Late Afternoon - (3.30 pm) | 930
(4 rows)
之后:
select * from sometable;
-[ RECORD 1 ]-+---------------------------
id | 1
time | 09:30
humanize_time | Early Morning - (9.30 am)
value | 570
-[ RECORD 2 ]-+---------------------------
id | 2
time | 11:30
humanize_time | Late Morning - (11.30 am)
value | 690
-[ RECORD 3 ]-+---------------------------
id | 3
time | 13:30
humanize_time | Early Afternoon - (1.30pm)
value | 810
-[ RECORD 4 ]-+---------------------------
id | 4
time | 15:30
humanize_time | Late Afternoon - (3.30 pm)
value | 930
1条答案
按热度按时间j7dteeu81#
你可以使用
CROSS JOIN
,CASE
以及UNION ALL
.