BigQuery : What is the easy way to return all columns from multiple table after joining them ?

Google Big Query @ Freshers.in

The SELECT expression.* syntax in BigQuery is used to select all columns from a specific source within the query. The source can be either a table, a subquery, or a join.

For example, consider a table named my_table with columns column1, column2, and column3. If you want to select all columns from my_table, you can use the following query:

SELECT my_table.*
FROM my_table;

The result of this query will be all rows from my_table with all columns (column1, column2, and column3).

Another example, consider you have two tables, freshers_table1 and freshers_table2. You can join the two tables and select all columns from table1 and table2 using the following query:

SELECT freshers_table1.*, freshers_table2.*
FROM freshers_table1
JOIN freshers_table2
ON freshers_table1.column1 = freshers_table2.column1;

This query will return all columns from both freshers_table1 and freshers_table2, joining the two tables on column1 and return all rows where freshers_table1.column1 = freshers_table2.column1.

It’s important to note that while the SELECT expression.* syntax is a convenient way to select all columns, it can increase the amount of data transferred and processing time, especially if you are selecting many columns or working with large tables. If you only need a subset of columns, it is more efficient to explicitly list the columns you need in the SELECT clause.

BigQuery import urls to refer

Author: user

Leave a Reply