我在esper中编写以下查询:
on pattern[every timer:interval(10 sec)] delete from OrderEvent as OE where OE.orderId IN (select orderId from OrderEvent group by orderId having last(orderAction) = CANCEL)
但它给我一个语法错误,如果不支持那么可以替代解决方案
答案 0 :(得分:0)
根据文档,它看起来像"有"子查询中不支持子句。另一种方法是选择并导致删除。
on pattern[..] insert into DELETED_ID select orderId from OrderEvent where orderAction=CANCEL
on DELETED_ID as del delete from OrderEvent as orderEvent where orderEvent.orderId = del.orderId