从MS Access迁移到Redshift

时间:2017-05-26 08:36:46

标签: sql ms-access amazon-redshift

我想将现有表格移至Amazon Redshift。以下是我在Access中的查询

SELECT [Top NAD Issues by Month Link].[COF Item Number]
    ,Nz([a.supplier], "NO COF INFO") AS Supplier
    ,Nz([a.subsystem], "NO COF INFO") AS Subsystem
    ,[Top NAD Issues by Month Link].[Business Unit Info]
INTO [Top NAD Issues by Month]
FROM (
    SELECT [COF Reference].[COF Item Number]
        ,[COF Reference].Supplier
        ,[COF Reference].Subsystem
        ,[COF Reference].[Project Group]
        ,[COF Reference].Project
        ,Count([COF Reference].[Claim Number]) AS [CountOfClaim Number]
    FROM [COF Reference]
    GROUP BY [COF Reference].[COF Item Number]
        ,[COF Reference].Supplier
        ,[COF Reference].Subsystem
        ,[COF Reference].[Project Group]
        ,[COF Reference].Project
    ORDER BY [COF Reference].[COF Item Number]
    ) a
RIGHT JOIN [Top NAD Issues by Month Link] ON a.[COF Item Number] = [Top NAD Issues by Month Link].[COF Item Number];

Redhisft中的等效查询是什么?

由于

1 个答案:

答案 0 :(得分:-1)

由于Amazon Redshift使用标准SQL,您可以在Redshift中使用相同的查询,您显示的查询没有任何特殊内容(只要您之前已经迁移了表[COF参考]和[按月排名的前NAD问题]链接]。