In this post, we will see how to resolve Join tables in bigquery
Question:
Hello I have 5 tables in bigquery as belowinner join and subquery
Best Answer:
The following query can give you the expected result.activity_date | userID | walking_value | swimming_value | running_value | cycling_value |
---|---|---|---|---|---|
2023-03-11 | abc | null | null | null | 12 |
2023-03-12 | abc | 32 | null | null | null |
2023-03-12 | xyz | 45 | null | null | null |
2023-03-18 | xyz | null | 12 | null | null |
2023-03-19 | def | null | 33 | null | null |
2023-03-19 | xyz | null | null | null | 22 |
2023-03-20 | abc | null | null | 21 | null |
2023-03-25 | def | null | null | null | 54 |
As I don’t have any free tool to show the output in BigQuery; I am trying to show the same in DBFIDDLE demo using SQL Server with different Datatypes than Bigquery. However; The above query shall work in Bigquery.
Based on update :
If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com