尝试在 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
错误:选择失败。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
错误:选择失败。3807:对象“TEMP”不存在。
Teradata 是否真的支持多个 WITH 子句或 WITH 子句内的 WITH?
我听说 14.x 更高版本支持它,但它不支持 15.x。