Unions

Use a UNION operator in your CCL query to combine the results of two or more queries into a single result.

When combining two or more queries, duplicate rows are eliminated from the result set unless you specify otherwise.

The input for a UNION operator comes from one or more streams or windows. Its output is a set of records representing the union of the inputs. This example shows a simple union between two windows, InStocks and InOptions:
CREATE INPUT WINDOW InStocks 
	SCHEMA StocksSchema 
	Primary Key (Ts)
;

CREATE INPUT WINDOW InOptions 
	SCHEMA OptionsSchema 
	Primary Key (Ts) 
;
CREATE output  Window  Union1  
	SCHEMA OptionsSchema
	PRIMARY KEY DEDUCED
	AS SELECT s.Ts as Ts, s.Symbol as StockSymbol, 
	       Null as OptionSymbol, s.Price as Price, s.Volume as Volume    
	 FROM InStocks s 
UNION 
	SELECT s.Ts as Ts, s.StockSymbol as StockSymbol,
           s.OptionSymbol as OptionSymbol,  s.Price as Price, 
           s.Volume as Volume
    FROM InOptions s
;
Related concepts
Pattern Matching
Related reference
Filtering
Splitting Up Incoming Data
Joins
Aggregation