from <event-regular-expression-of-streams> within <time>
select <attribute-name> {, <attribute-name>}
insert into <stream-name>
...
When “within <time>” is used, just like with patterns, Siddhi will output only the events that are within that time of each other.
After one or more occurrence of infoStock event with action == "buy", the query matches StockExchangeStream events with maximum of one event with price between 70 and 75 and one event with price >= 75
from every a1 = infoStock[action == "buy"]+,
b1 = StockExchangeStream[price > 70]?,
b2 = StockExchangeStream[price >= 75]
select a1[0].action as action, b1.price as priceA, b2.price as priceBJoin
insert into StockQuote
...