ClickHouse/tests/queries/0_stateless/03002_modify_query_cte.sql
2024-03-02 15:28:45 +00:00

16 lines
391 B
SQL

CREATE TABLE table_03002 (ts DateTime, event_type String) ENGINE = MergeTree ORDER BY (event_type, ts);
CREATE MATERIALIZED VIEW mv_03002 TO table_03002 AS SELECT ts FROM table_03002;
SHOW CREATE TABLE mv_03002;
ALTER TABLE mv_03002 MODIFY QUERY
WITH MY_CTE AS (SELECT ts FROM table_03002)
SELECT * FROM MY_CTE;
SHOW CREATE TABLE mv_03002;
DROP TABLE mv_03002;
DROP TABLE table_03002;