操作无效:不支持WITH RECURSIVE

时间:2017-07-24 17:56:39

标签: amazon-redshift common-table-expression recursive-query

当我在下面运行查询时,我收到消息:

[Amazon](500310) Invalid operation: WITH RECURSIVE is not supported;

有人能解释一下为什么递归函数不起作用? (我正在研究亚马逊红移)

WITH RECURSIVE r AS (
    SELECT 
        1 AS i, 
        1 AS factorial
    UNION 
    SELECT 
        i+1 AS i, 
        factorial * (i+1) as factorial 
    FROM r
    WHERE i < 10
)
SELECT * FROM r;

2 个答案:

答案 0 :(得分:2)

官方Amazon Redshift文档:Unsupported PostgreSQL Features

  

Amazon Redshift不支持这些PostgreSQL功能。
  ... ... ...    - 递归公用表表达式
  ...

答案 1 :(得分:0)