我想从以下数据集创建一个数据透视表:
ids每隔252行重复一次新日期和不同数量:
我正在运行以下查询以获取数据透视表:
select * from crosstab(
'select id, thedate, quantity
from mytable
order by 1,2'
) as t(id integer, thedate timestamp)
但我收到以下错误:
ERROR: return and sql tuple descriptions are incompatible
SQL state: 42601