嘿,我正在尝试将 2 个 Oracle SQL 查询合并为一个。这些查询将在 Pega 中使用。到目前为止,这是我想出的:
WITH
Query1 as (DELETE FROM PC WHERE PXNAME = '84461' AND PXCLASS = 'DocQuery'),
Query2 as (DELETE FROM WORK WHERE PXNAME = '84461' AND PXWORKCLASS = 'DocQuery')
SELECT * FROM Query1, Query2 WHERE Query1.RecordID = Query2.RecordID;
原来的2个查询是:
Query 1: DELETE FROM PC WHERE PXNAME = {.RecordID in} AND PXCLASS = {.RecordClass in}
Query 2: DELETE FROM WORK WHERE PXNAME = {.RecordID in} AND PXWORKCLASS = {.RecordClass in}
所以当我运行它给我这个错误:
ORA-00928: 缺少 SELECT 关键字
- 00000 - “缺少 SELECT 关键字”
*原因:
*行动:
行错误:2 列:14
需要 SQL 大师 :)