@Name("DetectoCambiosPares")
INSERT INTO DetectorPares
SELECT a1.systemNumber, a1.time,a1.events,
a2.systemNumber, a2.time,a2.events,
a3.systemNumber, a3.time,a3.events,
a4.systemNumber, a4.time,a4.events,
a5.systemNumber, a5.time,a5.events,
a6.systemNumber, a6.time,a6.events
FROM PATTERN [every (a1 = RankingProd()->
a2 = RankingProd() ->
a3 = RankingProd() -> timer:interval(2 hours)->
a4 = RankingProd() ->
a5 = RankingProd() ->
a6 = RankingProd())
]
WHERE (a1.systemNumber = a4.systemNumber AND
a2.systemNumber=a5.systemNumber AND
a3.systemNumber=a6.systemNumber)!=TRUE;
答案 0 :(得分:0)
是每天下午3点还是某一天?
该模式应该保持多长时间?直到第二天下午3点?永远?或者直到有匹配?如果每天下午3点没有匹配,可以同时激活多少个模式?
这是一个解决方案,在此后的第一天下午3点开始模式:
create context From3PMEachDay start (0, 15, *, *, *);
context From3PMEachDay INSERT INTO DetectorPares
SELECT a1.systemNumber, a1.time,a1.events, ....
... the pattern here just like you have it...;
对于每天下午3点开始的模式
create context From3PMEachDay initiated by (0, 15, *, *, *);