简体   繁体   English

WSO2 SIDDHI查询类似“不存在”

[英]WSO2 SIDDHI Query like “not exists”

I have not found any way to express a query with something like "not exists". 我还没有找到表达“不存在”之类的查询的任何方法。

For example, to simply test that all the devices are ok, or send an alert if one of them is missing for a given time, a query like : 例如,要简单地测试所有设备是否正常,或者如果在给定时间内缺少其中一个设备就发送警报,请执行以下查询:

from every myDeviceTable
join not exists myEvents[myEvents.DeviceID == myDeviceTable.ID]#window.time(5 sec)
select myDeviceTable.ID as deviceID, "Message...", ...
insert into myAlertTable

Some help please ? 请帮忙吗?

Regards. 问候。

You can use the not keyword as follows: (Assuming myDeviceTable is an event table) 您可以按如下方式使用not关键字:(假设myDeviceTable是事件表)

from myEvents[not(DeviceID == myDeviceTable.ID in myDeviceTable)] 
select DeviceID, "message..",
insert into myAlertTable;

If you want to select attributes that resides only inside the table, use another join query for that using the outputs of this query. 如果要选择仅位于表内部的属性,请对该查询的输出使用另一个联接查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM