0

我尝试使用 UNION 子查询返回的结果加入表。但是我从下面的查询中得到语法错误。是否可以使用 Pervasive 数据库来完成这样的任务?我正在使用 Pervasive v8。

SELECT * FROM 
Table1 INNER JOIN Table2 ON Table1.BKAR_INV_NUM = Table2.BKAR_INVL_INVNM 
INNER JOIN 
(
SELECT BKAR_INVL_INVNM as SO_Num, BKAR_INVL_CNTR as Line, BKAR_INVL_ASD as Due_Date FROM Table3 
UNION SELECT BKAR_INVL_INVNM as SO_Num, BKAR_INVL_CNTR as Line, BKAR_INVL_ASD as Due_Date FROM Table4 WHERE BKAR_INVL_ASD IS NOT NULL
) AS SubTable 
ON SubTable.SO_Num = Table1.BKAR_INV_SONUM AND SubTable.Line = Table2.BKAR_INVL_CNTR
4

1 回答 1

0

根据我的研究,Pervasive v8 支持 UNION,但不支持子查询。

于 2017-08-28T13:31:34.313 回答