How to Create a View in ClickHouse

Last updated July 25, 2026 · By the SaturnSQL team

Use CREATE VIEW ... AS SELECT. A normal view is just a stored query expanded at query time; it holds no data and adds no storage cost. Use CREATE OR REPLACE VIEW to change its definition in place.

CREATE OR REPLACE VIEW recent_signups AS
SELECT user_id, event_time, url
FROM events
WHERE event_type = 'signup'
  AND event_time > now() - INTERVAL 30 DAY;

Because the view's SELECT runs on every query, an expensive aggregation stays expensive. If you need precomputed results, use a materialized view writing into a target table instead.

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related ClickHouse guides

© 2026 Panda Capital Oy Ab. All rights reserved.