Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mindsdb.com/llms.txt

Use this file to discover all available pages before exploring further.

Description

The CREATE VIEW statement creates a view, which is a great way to do data preparation in MindsDB. A VIEW is a saved SELECT statement, which is executed every time we call this view.

Syntax

Here is the syntax:
CREATE VIEW [IF NOT EXISTS] project_name.view_name AS (
    SELECT columns
    FROM integration_name.table_name AS a
    JOIN integration_name.table_name AS p ON a.id = p.id
    JOIN ...
);
Here is how to list all views:
SHOW VIEWS;