Teradata 是否支持 -Multiple With 子句?

Does Teradata support -Multiple With Clause?

尝试在 SQLAssitant (v 15.x Teradata) 中执行:

WITH   TEMP1 (EMP_ID,E_NAME,E_SAL) AS (WITH TEMP (EMP_ID,E_NAME,E_SAL) AS (SELECT EMP_ID,E_NAME,E_SAL FROM EMP_TABLE_TEST)
SELECT EMP_ID,E_NAME,E_SAL FROM TEMP) SELECT EMP_ID,E_NAME,E_SAL FROM TEMP1

错误:SELECT失败。 6926: 定义、视图、触发器或存储过程

WITH TEMP (EMP_ID,E_NAME,E_SAL) AS (SELECT EMP_ID,E_NAME,E_SAL FROM EMP_TABLE_TEST ) , TEMP1  (EMP_ID,E_NAME,E_SAL) AS (
SELECT EMP_ID,E_NAME,E_SAL FROM TEMP) SELECT  EMP_ID,E_NAME,E_SAL FROM TEMP1

错误:SELECT失败。 3807: 对象 'TEMP' 不存在。

Teradata 是否真的支持多个 WITH 子句或 WITH 子句中的 WITH?

听说 14.x 更高版本支持,但 15.x 不支持。

语法不同(与其他数据库相同)
With t1 as (...),t2 as (...), t3 as (...) select ...


目前参考顺序是颠倒的-
t2 可以引用 t3,t1 可以引用 t2 和 t3。
"right"订单将在TD16中得到支持。

这已在 Teradata 16 中修复。请参阅发布摘要第 2 章。

http://www.info.teradata.com/doclist.cfm?RetainParams=Y&FilterCall=Y&selDocType=100

Previously, when a nonrecursive WITH clause defined multiple CTEs, a CTE could only reference a subsequent CTE in the WITH clause. Now, a CTE can reference a preceding or subsequent CTE in the WITH clause.

来自版本 16 的 Teradata 发布摘要