【发布时间】:2018-06-28 20:20:34
【问题描述】:
我有什么
customerid status
Ax 1
Bx 3
Cx 5
Dx 4
Ex 2
我希望在表格上方旋转。
我需要什么
customerid status_1 status_2 status_3 status_4 status_5
Ax 1 0 0 0 0
Bx 0 0 1 0 0
Cx 0 0 0 0 1
Dx 0 0 0 1 0
Ex 0 1 0 0 0
【问题讨论】:
标签: sql postgresql pivot greenplum