在 hiveQL 中使用"where not exists"子句时"Mismatched input 'select'"错误



为什么下面的hive查询会生成一个"不匹配的输入"选择";错误

select d1.* from
(select dim_iso_code from tableA where ds='2022-06-01') d1
where not exists
select d2.* from
(select dim_iso_code from tableA where ds='2022-04-18') d2
where d1.dim_iso_code = d2.dim_iso_code    

"消息":"第4:1行:输入"select"不匹配。应为:"(","errorCode":1,"errorName":"SYNTAX_ERROR","errorType":"USER_ERROR",

我对此尝试了许多变体,但都因类似的错误而失败。

以下内容正在工作-从最初的简化了一点

select d1.* from 
(select dim_iso_code from tableA where ds='2022-06-01') d1
where not exists
(select dim_iso_code from tableA where ds='2022-04-18')