嘿,我只是想把两个oraclesql查询合并成一个。这些查询将在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;
最初的两个查询是:
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-“缺少选择关键字”
- 原因:
- 行动:
第2行第14列出错
需要sqlMaven:)
1条答案
按热度按时间9rygscc11#
也许您可以尝试在delete之后在第一个表上创建触发器,并在其中的第二个表上写入delete。