CLUSTER BY

Create table option

Description

CLUSTER BY is an optional clause that controls table clusteringarrow-up-right. For more information, please refer to clustering column listarrow-up-right.

circle-check

Sample Source

BigQuery (Input Code)

CREATE TABLE clustered_table
(
  customer_id INT,
  transaction_amount NUMERIC
)
CLUSTER BY
  customer_id
AS (
  SELECT * FROM unclustered_table
);

Snowflake (Output Code)

Last updated

Was this helpful?