# BigQuery INFORMATION_SCHEMA.JOBS: Syntax and Examples | Masthead

INFORMATION_SCHEMA.JOBS lists every BigQuery job in a project for the last 180 days, with bytes billed, slot milliseconds, errors and query text. Query it to find the most expensive queries, attribute cost by user or label, and turn total_bytes_billed into an on-demand cost estimate.

> For the index of this section of the site, see [llms.txt](https://mastheadata.com/llms.txt)

BigQuery · Metadata view

# BigQuery INFORMATION\_SCHEMA.JOBS

INFORMATION\_SCHEMA.JOBS lists every BigQuery job in a project for the last 180 days, with bytes billed, slot milliseconds, errors and query text. Query it to find the most expensive queries, attribute cost by user or label, and turn total\_bytes\_billed into an on-demand cost estimate.

GoogleSQL for BigQuery · Checked against the [official reference](https://docs.cloud.google.com/bigquery/docs/information-schema-jobs) in November 2026

`INFORMATION_SCHEMA.JOBS` (the same view as `JOBS_BY_PROJECT`) has one row per job in the current project and region: queries, loads, extracts and copies, running or finished in the last 180 days. It is the raw material for any BigQuery cost report. `total_bytes_billed`, `total_slot_ms`, `cache_hit`, `error_result`, `labels`, `reservation_id`, `referenced_tables` and the full `query` text are all columns. The data behind the view is partitioned by `creation_time` and clustered by `project_id` and `user_email`, so every query against it should filter on `creation_time`.

On-demand cost is `total_bytes_billed / POW(1024, 4) * 6.25` at the US list price of $6.25 per TiB (see [BigQuery pricing](https://mastheadata.com/bigquery/pricing.md) for other regions). The column already includes the 10 MB minimums and is 0 for cache hits, but it does not subtract the free first TiB of each month. Failed queries are not charged, while a canceled query (`error_result.reason = 'stopped'`) can be, so Google's own billing query keeps only rows where `error_result IS NULL OR error_result.reason = 'stopped'`. On capacity (editions) pricing the bytes figure is informational: convert `total_slot_ms` to slot-hours by dividing by 3,600,000 and multiply by your edition's slot-hour rate for an attribution estimate.

Two details inflate naive totals. A multi-statement query appears as a parent row with `statement_type = 'SCRIPT'` whose bytes and slot time already include all of its child jobs, so exclude SCRIPT rows before you sum. And BigQuery bills jobs by `end_time` in the PST8PDT time zone, so daily totals grouped by UTC `creation_time` will not line up exactly with Cloud Billing.

`JOBS` covers every user in the project and needs the `bigquery.jobs.listAll` permission (BigQuery Resource Viewer) plus `bigquery.jobs.create`. `JOBS_BY_USER` returns only your own jobs and needs just `bigquery.jobs.list` (BigQuery User). `JOBS_BY_ORGANIZATION` covers every project in the organization, needs BigQuery Resource Viewer on the organization, and has no `query` or `dml_statistics` column. All of them need a region qualifier such as `region-us`, and the query must run in that location. Region qualifiers are not hierarchical: `region-us` is the US multi-region and does not include `us-central1`, so a project with datasets in several locations needs one query per region. See [INFORMATION\SCHEMA](https://mastheadata.com/bigquery/sql/information-schema.md) for the other views.

## Syntax

```
SELECT ... FROM [project_id.]`region-REGION`.INFORMATION_SCHEMA.JOBS[_BY_PROJECT]

SELECT ... FROM [project_id.]`region-REGION`.INFORMATION_SCHEMA.JOBS_BY_USER

SELECT ... FROM [project_id.]`region-REGION`.INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION
```

## Arguments and return value

| Argument | Description |
| --- | --- |
| `project_id` | Optional. The project whose jobs you read. Defaults to the project that runs the query. For `JOBS_BY_ORGANIZATION` it only selects the organization that contains the project. |
| `REGION` | Required. A dataset location in the form `region-us`, `region-eu` or `region-europe-west3`; the query must run in that location. Without a project prefix the qualifier works unquoted. With one, put the project and the region in backticks: an unquoted `my-project.region-us` is a syntax error. |
| `total_bytes_billed` | INT64 column. Bytes billed for the job under on-demand pricing, after the 10 MB minimums; 0 for cache hits. Informational only on capacity pricing. |
| `total_bytes_processed` | INT64 column. Bytes the job read. This is what a dry run estimates, before minimums are applied. |
| `total_slot_ms` | INT64 column. Slot milliseconds of the last execution, excluding earlier retries. Divide by 3,600,000 for slot-hours. |
| `creation_time` | TIMESTAMP column. The partitioning column of the view: filter on it to limit how much job history you scan. |
| `statement_type` | STRING column, such as `SELECT`, `INSERT`, `UPDATE`, `DELETE`, `MERGE` or `SCRIPT`. SCRIPT rows are parents of multi-statement queries and double count their children. |
| `error_result` | RECORD column with `reason` and `message`. NULL for jobs that succeeded. |
| `cache_hit` | BOOL column. TRUE when the results came from the query cache and nothing was billed. |
| `labels` | ARRAY of STRUCT<key STRING, value STRING>. Job labels for cost attribution by team, pipeline or dashboard. |

**Returns:** One row per job: running jobs plus job history for the past 180 days, for the selected project (or user, or organization) and region.

## Examples

### Most expensive queries of the last 7 days

Sorts by bytes billed and adds an on-demand cost estimate at $6.25 per TiB and the slot-hours each job consumed. Sort by `total_slot_ms` instead if the project runs on a reservation.

```
SELECT
  job_id,
  user_email,
  creation_time,
  ROUND(total_bytes_billed / POW(1024, 4), 3) AS tib_billed,
  ROUND(total_bytes_billed / POW(1024, 4) * 6.25, 2) AS est_on_demand_usd,
  ROUND(total_slot_ms / 3600000, 2) AS slot_hours,
  LEFT(query, 200) AS query_start
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND job_type = 'QUERY'
  AND statement_type != 'SCRIPT'
  AND (error_result IS NULL OR error_result.reason = 'stopped')
ORDER BY total_bytes_billed DESC
LIMIT 20;
```

### Cost by user for the current month

The same estimate grouped by `user_email`. Service accounts show up here too, which is usually where scheduled pipelines and BI tools hide.

```
SELECT
  user_email,
  COUNT(*) AS jobs,
  COUNTIF(cache_hit) AS cache_hits,
  ROUND(SUM(total_bytes_billed) / POW(1024, 4), 2) AS tib_billed,
  ROUND(SUM(total_bytes_billed) / POW(1024, 4) * 6.25, 2) AS est_on_demand_usd,
  ROUND(SUM(total_slot_ms) / 3600000, 1) AS slot_hours
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_TRUNC(CURRENT_TIMESTAMP(), MONTH)
  AND job_type = 'QUERY'
  AND statement_type != 'SCRIPT'
  AND (error_result IS NULL OR error_result.reason = 'stopped')
GROUP BY user_email
ORDER BY est_on_demand_usd DESC;
```

### Failed jobs grouped by error reason

`error_result.reason` is the short code, such as `invalidQuery`, `resourcesExceeded`, `accessDenied`, `notFound`, `quotaExceeded`, `bytesBilledLimitExceeded` or `stopped` for canceled jobs. One sample message per reason is usually enough to see what broke.

```
SELECT
  error_result.reason AS reason,
  COUNT(*) AS failed_jobs,
  COUNT(DISTINCT user_email) AS users,
  ANY_VALUE(error_result.message) AS sample_message
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND error_result IS NOT NULL
GROUP BY reason
ORDER BY failed_jobs DESC;
```

### The cost arithmetic on sample job rows

1 TiB is 1024^4 bytes and a slot-hour is 3,600,000 slot milliseconds. The cached rerun bills nothing. The Enterprise column multiplies slot-hours by the $0.06 pay-as-you-go rate: an attribution estimate, not the reservation invoice.

```
WITH jobs AS (
  SELECT 'nightly_rollup' AS job, 3298534883328 AS total_bytes_billed, 9000000 AS total_slot_ms UNION ALL
  SELECT 'adhoc_backfill', 549755813888, 1800000 UNION ALL
  SELECT 'cached_rerun', 0, 0
)
SELECT
  job,
  total_bytes_billed / POW(1024, 4) AS tib_billed,
  ROUND(total_bytes_billed / POW(1024, 4) * 6.25, 2) AS on_demand_usd,
  total_slot_ms / 3600000 AS slot_hours,
  ROUND(total_slot_ms / 3600000 * 0.06, 2) AS enterprise_usd
FROM jobs
ORDER BY total_bytes_billed DESC;
```

Result
| job | tib\_billed | on\_demand\_usd | slot\_hours | enterprise\_usd |
| --- | --- | --- | --- | --- |
| nightly\_rollup | 3.0 | 18.75 | 2.5 | 0.15 |
| adhoc\_backfill | 0.5 | 3.13 | 0.5 | 0.03 |
| cached\_rerun | 0.0 | 0.0 | 0.0 | 0.0 |

## Common mistakes

*   Summing SCRIPT rows together with their child jobs. The parent row of a multi-statement query already includes its children's bytes and slot time, so totals come out roughly double. Add `statement_type != 'SCRIPT'`.
*   Reading the wrong location. `region-us` is the US multi-region only; jobs that ran in `us-central1`, `EU` or `europe-west3` are in their own views, and one query cannot join regions. Querying with the wrong qualifier fails with a [Not found](https://mastheadata.com/bigquery/errors/table-not-found.md) error that names the location.
*   Treating the estimate as the invoice. `total_bytes_billed` does not subtract the free first TiB per month, failed jobs are not charged, and on capacity pricing you pay for the slots the reservation and autoscaler allocate, not for `total_slot_ms`. Reconcile with Cloud Billing, or with `INFORMATION_SCHEMA.RESERVATIONS_TIMELINE` for reservations.
*   Expecting query text in `JOBS_BY_ORGANIZATION`. It has no `query` column. Find the expensive `job_id` at organization level, then read the text from that project's `JOBS` view.
*   Writing the view name in lowercase. `INFORMATION_SCHEMA` view names are case-sensitive, and `region-us.information_schema.jobs` is read as an ordinary dataset and table, which fails with an [Access Denied](https://mastheadata.com/bigquery/errors/access-denied-permission-to-query-table.md) error that suggests the table may not exist.

## Cost and performance

*   On on-demand projects every `INFORMATION_SCHEMA` query bills at least 10 MB and is never cached, so a dashboard that refreshes a JOBS query every few minutes pays each time. Point dashboards at a daily summary table instead.
*   Filter on `creation_time` (the partitioning column) so BigQuery scans only the days you need; `project_id` and `user_email` are clustering columns. A dry run of a JOBS query can report far more bytes than the query reads, because the estimate only accounts for the `creation_time` filter.
*   History stops at 180 days. To compare costs year over year, append yesterday's rows to your own table partitioned by `DATE(creation_time)` with a scheduled `INSERT ... SELECT`, filtered to one day per run.

## FAQ

How do I find the most expensive queries in BigQuery?

Query `region-us.INFORMATION_SCHEMA.JOBS` with a `creation_time` filter, exclude `statement_type = 'SCRIPT'`, and order by `total_bytes_billed` on on-demand pricing or by `total_slot_ms` on a reservation. The first example on this page does both.

How do I calculate query cost from INFORMATION\_SCHEMA.JOBS?

On-demand: `total_bytes_billed / POW(1024, 4) * 6.25` gives US list-price dollars per job. On editions: `total_slot_ms / 3600000` gives slot-hours, which you multiply by your edition's slot-hour rate from [BigQuery pricing](https://mastheadata.com/bigquery/pricing.md).

What is the difference between JOBS, JOBS\_BY\_USER and JOBS\_BY\_ORGANIZATION?

Scope and permissions. `JOBS` shows every user's jobs in one project (`bigquery.jobs.listAll`), `JOBS_BY_USER` only your own (`bigquery.jobs.list`), and `JOBS_BY_ORGANIZATION` every project in the organization, without the `query` and `dml_statistics` columns.

How do I break BigQuery cost down by label?

Unnest the labels array: `FROM region-us.INFORMATION_SCHEMA.JOBS, UNNEST(labels) AS l WHERE l.key = 'team'`, then group by `l.value`. Jobs without that label drop out of a comma join, so count them separately.

## Related

[INFORMATION\SCHEMA](https://mastheadata.com/bigquery/sql/information-schema.md)[PARTITION BY (partitioned tables)](https://mastheadata.com/bigquery/sql/partition-by.md)[CLUSTER BY](https://mastheadata.com/bigquery/sql/cluster-by.md)[INSERT](https://mastheadata.com/bigquery/sql/insert.md)[CREATE TABLE](https://mastheadata.com/bigquery/sql/create-table.md)[CREATE MATERIALIZED VIEW](https://mastheadata.com/bigquery/sql/create-materialized-view.md)[MERGE](https://mastheadata.com/bigquery/sql/merge.md)[TABLESAMPLE SYSTEM](https://mastheadata.com/bigquery/sql/tablesample.md)

### Errors you may hit

[Table was not found in location](https://mastheadata.com/bigquery/errors/table-not-found.md)[User does not have permission to query table, or perhaps it does not exist](https://mastheadata.com/bigquery/errors/access-denied-permission-to-query-table.md)

[All BigQuery INFORMATION\SCHEMA](https://mastheadata.com/bigquery/information-schema-views.md) · [All statements and clauses](https://mastheadata.com/bigquery/sql.md) · [BigQuery error messages](https://mastheadata.com/bigquery/errors.md)
---

## Other pages in sql

> For the full index of this section, see [BigQuery Reference](https://mastheadata.com/llms/llms-bigquery-reference.txt).

- [BigQuery ALTER TABLE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/alter-table.md): ALTER TABLE changes a BigQuery table without rewriting it: ADD COLUMN, DROP COLUMN, RENAME TO, RENAME COLUMN, SET OPTIONS (expiration, description, labels, partition filter) and ALTER COLUMN SET DATA TYPE for widening changes such as INT64 to NUMERIC. These are metadata changes and process no bytes.
- [BigQuery CLUSTER BY: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/cluster-by.md): CLUSTER BY sorts a BigQuery table's storage blocks by up to four columns, so queries that filter on those columns skip blocks and bill fewer bytes. Use it on large tables filtered by columns such as customer_id or status, usually on top of date partitioning.
- [BigQuery CREATE FUNCTION: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/create-function.md): CREATE FUNCTION defines a user-defined function (UDF) in SQL or JavaScript. CREATE TEMP FUNCTION lives for one query or script; CREATE FUNCTION dataset.name is persistent and shared. Prefer SQL UDFs: they are inlined, while JavaScript UDFs use more slots and lack 64-bit integers.
- [BigQuery CREATE MATERIALIZED VIEW: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/create-materialized-view.md): CREATE MATERIALIZED VIEW stores the result of an aggregation over a BigQuery table and keeps it current automatically. Queries read the small precomputed result plus recent changes instead of rescanning the base table, cutting cost for dashboards that repeat the same GROUP BY.
- [BigQuery CREATE TABLE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/create-table.md): CREATE TABLE creates a BigQuery table from a column list, from a query (CREATE TABLE AS SELECT), or both, with optional partitioning, clustering and OPTIONS such as expiration and description. Add OR REPLACE to overwrite a table or IF NOT EXISTS to skip one that exists.
- [BigQuery CREATE TEMP TABLE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/create-temp-table.md): CREATE TEMP TABLE stores intermediate results in a table that exists only for the current multi-statement query or session, without a dataset. Use it to compute an expensive step once and reuse it, instead of a CTE that BigQuery re-runs at every reference.
- [BigQuery CREATE VIEW: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/create-view.md): CREATE VIEW saves a query under a table-like name. A BigQuery view stores no data and re-runs its query on every use, billed for the underlying tables' bytes. Authorize the view on the source dataset to share a filtered subset without granting access to the tables.
- [BigQuery DECLARE and SET: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/declare-set.md): DECLARE creates a variable in a BigQuery multi-statement query and SET assigns it: DECLARE run_date DATE DEFAULT CURRENT_DATE(); SET run_date = '2026-11-22'. Variables make scripts reusable, and a date variable in a WHERE clause still prunes partitions.
- [BigQuery DELETE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/delete.md): DELETE removes the rows of a BigQuery table that match a WHERE clause, which is mandatory. A DELETE that covers whole partitions and filters only on the partitioning column can drop them without scanning bytes; any other DELETE bills the bytes read plus the size of the table or partitions it rewrites.
- [BigQuery EXECUTE IMMEDIATE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/execute-immediate.md): EXECUTE IMMEDIATE runs a SQL statement built as a string at run time, with values bound through USING and results stored with INTO. Use it for dynamic table names, generated PIVOT column lists and maintenance across many tables; bind values as parameters, never by concatenation.
- [BigQuery EXPORT DATA: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/export-data.md): EXPORT DATA writes the result of a query to files in Cloud Storage (CSV, JSON, Avro or Parquet), or to Bigtable, Spanner, Pub/Sub or AlloyDB. The export itself is free; you pay for the query that produces the data, and the URI must contain one  wildcard.
- [BigQuery GROUP BY ROLLUP, CUBE and GROUPING SETS: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/group-by-rollup.md): ROLLUP, CUBE and GROUPING SETS compute several GROUP BY levels in one query: ROLLUP(a, b) adds subtotals per a and a grand total, CUBE(a, b) adds every combination, and GROUPING SETS lists the exact groupings you want. GROUPING() tells subtotal rows from real NULLs.
- [BigQuery INFORMATION_SCHEMA: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/information-schema.md): INFORMATION_SCHEMA is BigQuery's set of read-only metadata views for tables, columns, partitions, storage and jobs. Query mydataset.INFORMATION_SCHEMA.TABLES or region-us.INFORMATION_SCHEMA.TABLE_STORAGE to audit schemas, find large tables and estimate storage cost. Each on-demand query bills at least 10 MB.
- [BigQuery INSERT: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/insert.md): INSERT adds rows to a BigQuery table from a VALUES list or a SELECT query. On-demand it bills only the bytes the SELECT reads. Insert in batches: BigQuery is not built for row-by-row INSERTs, and after 1,500 INSERT statements on a table in a day, extra ones are queued.
- [BigQuery JOIN: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/join.md): JOIN combines rows of two tables on a condition: INNER JOIN keeps matches, LEFT, RIGHT and FULL OUTER JOIN also keep unmatched rows with NULLs, and CROSS JOIN pairs every row with every row. In BigQuery a comma or CROSS JOIN with UNNEST flattens an array column.
- [BigQuery LOAD DATA: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/load-data.md): LOAD DATA loads files from Cloud Storage (CSV, JSON, Avro, Parquet, ORC) into a BigQuery table from SQL: LOAD DATA INTO appends, LOAD DATA OVERWRITE replaces, and a missing table is created. If the load fails, the table is left unchanged.
- [BigQuery LOOP, WHILE and FOR...IN: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/loops.md): BigQuery scripts loop with LOOP ... END LOOP (exit with BREAK or LEAVE), WHILE condition DO ... END WHILE, REPEAT ... UNTIL ... END REPEAT, and FOR row IN (query) DO ... END FOR. Use them for backfills and maintenance, not row-by-row processing: each statement inside runs as its own job.
- [BigQuery MERGE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/merge.md): MERGE updates, inserts and deletes rows of a BigQuery table in one atomic statement, by matching it against a source table or query. It is BigQuery's upsert: WHEN MATCHED THEN UPDATE, WHEN NOT MATCHED THEN INSERT, and WHEN NOT MATCHED BY SOURCE THEN DELETE for rows that disappeared.
- [BigQuery PARTITION BY (partitioned tables): Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/partition-by.md): PARTITION BY in CREATE TABLE splits a BigQuery table into partitions by a DATE, TIMESTAMP or DATETIME column, by ingestion time, or by integer ranges. Queries that filter on the partitioning column read and bill only the matching partitions, which makes it the main lever on query cost.
- [BigQuery PIVOT: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/pivot.md): PIVOT turns row values into columns with an aggregate: PIVOT(SUM(revenue) FOR quarter IN ('Q1', 'Q2', 'Q3', 'Q4')) gives one revenue column per quarter. The IN list must be constants, so build it with EXECUTE IMMEDIATE when the values are dynamic.
- [BigQuery QUALIFY: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/qualify.md): QUALIFY filters rows on the result of a window function, the way HAVING filters on aggregates. Use it to keep the latest row per key or the top N per group without a subquery: QUALIFY ROW_NUMBER() OVER (PARTITION BY id ORDER BY updated_at DESC) = 1.
- [BigQuery SELECT * EXCEPT: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/select-except.md): SELECT  EXCEPT (col1, col2) returns every column except the ones you list. In BigQuery it also lowers on-demand cost, because excluded columns are not read: dropping a wide payload or blob column from SELECT  can cut the bytes billed by most of the table.
- [BigQuery SELECT * REPLACE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/select-replace.md): SELECT  REPLACE (expression AS column) returns every column but swaps the value of the named columns for an expression, keeping their names and positions. Use it to mask, round, cast or clean a few columns without listing all the others.
- [BigQuery TABLESAMPLE SYSTEM: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/tablesample.md): TABLESAMPLE SYSTEM (n PERCENT) reads a random subset of a BigQuery table's storage blocks instead of the whole table, so exploratory queries on large tables scan and bill only about n percent of the bytes. Results are approximate and change on every run.
- [BigQuery TRUNCATE TABLE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/truncate-table.md): TRUNCATE TABLE removes every row from a BigQuery table but keeps its schema, partitioning, clustering, description and labels. It is a metadata operation, so it costs nothing, unlike DELETE WHERE TRUE, which is billed as DML.
- [BigQuery UNION ALL and UNION DISTINCT: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/union.md): UNION ALL stacks the rows of two queries; UNION DISTINCT does the same and removes duplicates. BigQuery requires the ALL or DISTINCT keyword, matches columns by position unless you add BY NAME, and also offers INTERSECT DISTINCT and EXCEPT DISTINCT.
- [BigQuery UNPIVOT: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/unpivot.md): UNPIVOT turns columns into rows: UNPIVOT(amount FOR month IN (jan, feb, mar)) gives one row per month with its value in amount. Rows whose value is NULL are dropped unless you add INCLUDE NULLS.
- [BigQuery UPDATE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/update.md): UPDATE changes column values in existing BigQuery rows. The WHERE clause is mandatory (use WHERE TRUE to update every row), and UPDATE ... FROM joins another table. On-demand it bills the bytes read plus the full size of the table, or of the partitions being updated.
- [BigQuery WITH RECURSIVE: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/with-recursive.md): WITH RECURSIVE defines a CTE that references itself, so a query can walk hierarchies and graphs of unknown depth: org charts, category trees, dependency lineage. BigQuery stops a recursive CTE with an error after 500 iterations.
- [BigQuery WITH (CTE): Syntax and Examples | Masthead](https://mastheadata.com/bigquery/sql/with.md): WITH defines named subqueries (common table expressions) that the rest of a query can reference like tables. In BigQuery a non-recursive CTE is not materialized: each reference runs it again, so a CTE over a large table used three times is scanned and billed three times.
- [BigQuery SQL Syntax: Statements, Clauses, DDL and DML | Masthead](https://mastheadata.com/bigquery/sql.md): BigQuery SQL syntax reference: QUALIFY, PIVOT, MERGE, CTEs, partitioned and clustered tables, scripting and INFORMATION_SCHEMA. 31 statements and clauses with examples and cost notes.
