Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将取消PIVOT从SQL Server转换为红移_Sql_Amazon Redshift_Database Migration - Fatal编程技术网

将取消PIVOT从SQL Server转换为红移

将取消PIVOT从SQL Server转换为红移,sql,amazon-redshift,database-migration,Sql,Amazon Redshift,Database Migration,我有一个来自SQL Server的脚本,需要转换为红移 这是脚本的一部分,我有麻烦 UNPIVOT ( SeatCharge FOR Description IN ( PM_Core, PM_RCM, PM_Advanced_RCM, PM_Payroll, PM_DXM, PM_Messaging, PM_Tasks, Clinical_Core,

我有一个来自SQL Server的脚本,需要转换为红移

这是脚本的一部分,我有麻烦

    UNPIVOT
(
SeatCharge
FOR Description IN (
        PM_Core,
        PM_RCM,
        PM_Advanced_RCM,
        PM_Payroll,
        PM_DXM,
        PM_Messaging,
        PM_Tasks,
        Clinical_Core,
        Clinical_Data_Collection,
        Clinical_Auditing_Tools,
        Clinical_Group_Sessions,
        Clinical_ABC_Data,
        Clinical_AGA,
        LMS_Core,
        HRIS_PTO,
        LMS_Course_Groups,
        PM_Reach_Me,
        PM_Redshift,
        HRIS_Benefits,
        HRIS_Assets)
)u
如何正确地将其转换为红移?

您可以尝试在amazon红移中使用union all来进行UNPIVOT


执行UNPIVOT时,需要确保UNPIVOT列的数据类型相同。

为什么要减号?在
SELECT  PM_Core SeatCharge
FROM yourTable
union all
SELECT PM_RCM 
FROM yourTable
union all
SELECT PM_Advanced_RCM 
FROM yourTable
union all 
SELECT PM_Payroll 
FROM yourTable
union all 
SELECT PM_DXM 
FROM yourTable
....