from <event-regular-expression-of-streams> within <time>
insert into <stream-name> <attribute-name> {<attribute-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]
insert into StockQuote
a1[0].action as action, b1.price as priceA, b2.price as priceBJoin
...