【发布时间】:2020-04-08 05:59:33
【问题描述】:
我的表有下一个结果:
our_date | number_people
------------------------
23/09/19 | 26
24/09/19 | 26
总是只有两行
我想旋转这个结果并得到这个:
our_date_1 | number_people_1 | our_date_2 | number_people_2
-----------------------------------------------------------------
23/09/19 | 26 | 24/09/19 | 26
获取 number_people_1 和 number_people_2 之间的差异
我尝试:
select *
from table_1
pivot(
count(number_people)
for our_date in (:P_TODAY, :P_YESTERDAY)
)
这是我的实际错误:
ORA-56900: la variable de enlace no está soportada en la operación PIVOT|UNPIVOT
56900. 0000 - "bind variable is not supported inside pivot|unpivot operation"
*Cause: Attempted to use bind variables inside pivot|unpivot operation.
*Action: This is not supported.
怎么了?如何在 for 子句中使用动态值?
最好的问候
【问题讨论】: