Ask Your Question
4

Is the GROUP BY executed following the operations executed in the SELECT statement in BigQuery?

asked 2023-05-17 12:55:36 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-05-17 13:13:02 +0000

ladyg gravatar image

No, in BigQuery, the GROUP BY is executed before the operations specified in the SELECT statement. The query is executed in the following order:

  1. FROM clause
  2. WHERE clause
  3. GROUP BY clause
  4. SELECT clause
  5. HAVING clause
  6. ORDER BY clause

This order of execution is important to understand when writing complex queries that include multiple clauses.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-17 12:55:36 +0000

Seen: 10 times

Last updated: May 17 '23