我尝试使用UNION子查询返回的结果连接表。但是我从下面的查询中得到语法错误。是否有可能使用普适数据库完成这样的任务?我正在使用普遍的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
根据我的研究,Pervasive v8支持UNION,但它不支持子查询。