Learn Bigquery
Introduction
Architecture
Architecture Compute Storage
Unique Features
Enncryption Column Level Security Time Travel Caching Compression
Database Management
Create Table Create View Create Procedure
Best Practices
Execution plans
Interview Questions
Top Questions
26 Jan 21 ·  mCollins in Bigquery ·        Bookmark ·  Report ·  More actions.. Lock comments ·  Pin thread

Create View Statement in Google BigQuery

Create BigQuery View

CREATE OR REPLACE VIEW DATASET.VIEWNAME AS 
SELECT * FROM DATASET.TABLENAME;

Create BigQuery View with Joins

CREATE OR REPLACE VIEW DATASET.VIEWNAME AS 
SELECT A.ID,B.NAME FROM DATASET.TABLENAME A
INNER JOIN DATASET.TABLENAME B ON A.ID = B.ID;

Create BigQuery Materialized View

Materialized views are precomputed views that periodically cache results of a query for increased performance and efficiency. The Materialized views help improve performance and save cost. Take a look at its limitations

CREATE MATERIALIZED VIEW dataset.viewname
AS SELECT product_id, SUM(clicks) AS sum_clicks
FROM my_dataset.my_base_table
GROUP BY 1