【发布时间】:2021-01-21 01:52:36
【问题描述】:
我有一个问题,我怎样才能将聚合结果转为看起来像..
我正在尝试首先使用此查询来转换一个简单的聚合:
select sync_action action, count(sync_action) total
FROM my_table
group by sync_action
并旋转我正在使用的表格:
select * from (
select sync_action , count(sync_action) total
FROM my_table
group by sync_action )
pivot
(
count(sync_action)
for sync_action in ('delete','create')
)
;
我不知道错误在哪里,因为结果是:
想法与第一张图片相同。
有人可以帮帮我吗?
最好的问候
【问题讨论】:
标签: sql oracle pivot oracle19c