-- Create a window
CREATE WINDOW FilteredTradesWindow
SCHEMA (Symbol STRING, Price FLOAT,
Volume INTEGER)
KEEP 3 ROWS PER Symbol;
-- Insert rows into the window
INSERT INTO FilteredTradesWindow
SELECT *
FROM StockTrades;
Adding the PER clause specifies that the window maintain three rows for each unique value in the Symbol column, rather than three rows total. Note the green bar to the left of the statement in the Queries tab, which is an indicator of the relationship between this CCL statement and the associated component in the Explorer view and the Flow view.