Join Windows

Use the FROM clause with ANSI JOIN syntax to join two windows.

The example creates two schemas named StocksSchema and OptionsSchema, and an output schema named OutSchema.

The example then creates two input windows named InStocks and InOptions, which use the structures defined in StocksSchema and OptionsSchema, respectively.

Finally, the example creates an output join window that uses the structure defined in OutSchema to join the InStocks and InOptions input windows using their symbol and timestamp values.


CREATE Output Window OutStockOption  SCHEMA OutSchema
	Primary Key ( Ts) 
	KEEP ALL 
AS 
	SELECT InStocks.Ts Ts , 
		InStocks.Symbol Symbol , 
		InStocks.Price StockPrice , 
		InStocks.Volume StockVolume , 
		InOptions.StockSymbol StockSymbol ,
		InOptions.OptionSymbol OptionSymbol , 
		InOptions.Price OptionPrice, 
		InOptions.Volume OptionVolume
	FROM InStocks   JOIN InOptions 
	  on
	    InStocks.Symbol = InOptions.StockSymbol and InStocks.Ts = InOptions.Ts ;