我有一个 WITH 子句,它给了我想要的结果,我试图把它放在一个变量中。为简单起见,我省略了代码。最后一行代码是最相关的。
WITH ALL_VE_ERRORS AS (
SELECT *
FROM ASN.AN_VALIDATION_ERRORS
WHERE ...
), FILTER_STATUS AS (
SELECT *
FROM ALL_VE_ERRORS
WHERE ...
) SELECT UNIT_DISCREPANCY FROM FILTER_STATUS INTO W_UNIT_DISCREPANCY; <-- like this
但这不起作用,编译器不喜欢这样。我也试过把它放在第一位:
SELECT INTO W_UNIT_DISCREPANCY <-- or like this
WITH ALL_VE_ERRORS AS (...
任何人都知道做这样的事情的正确语法吗?