Ask Your Question
4

What is the method for exchanging the outcome of a Query among distinct Jobs within BigQuery?

asked 2023-05-28 17:36:52 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-05-28 18:04:01 +0000

lalupa gravatar image

The method for exchanging the outcome of a Query among distinct Jobs within BigQuery is through using temporary tables or views.

Here are the steps in using temporary tables or views:

  1. Run the first query and save the result to a temporary table using the CREATE TABLE AS SELECT statement.
CREATE TEMP TABLE temp_table AS
SELECT column1, column2, ...
FROM table1
WHERE date_column = '2021-01-01';
  1. In the second query, reference the temporary table in the FROM clause to join or filter the data.
SELECT a.column1, b.column2
FROM table2 a
JOIN temp_table b ON a.id = b.id
WHERE b.column1 = 'value';

Note: - Temporary tables are only visible to the current session and will be automatically deleted when the session ends. - Temporary views can also be used in the same way as temporary tables.

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-28 17:36:52 +0000

Seen: 1 times

Last updated: May 28 '23