I'm trying to run the following query but keep on encountering the same error
Query Failed Error: Encountered "" at line 6, column 33. Was expecting one of:
The query is:
SELECT 1_0_MEMBER_GROUP.User_Group,
1_0_MEMBER_GROUP.Member_ID,
1_4_MEMBER_TRAN_YEAR.MEMBER_UID
FROM [Dataset1.1_0_MEMBER_GROUP]
JOIN [Dataset1.1_4_MEMBER_TRAN_YEAR]
ON 1_0_MEMBER_GROUP.Member_ID = 1_4_MEMBER_TRAN_YEAR.MEMBER_UID
I can't work out why it won't run and must be over looking something very simple.
Click the join and choose Delete. Create a new join by dragging the column name from the second table to the corresponding column name in the first table. Click Execute SQL. If a preview of your data appears in the Sample Preview pane, the join was successfully created.
Cross joins (Cartesian product) Cross joins are queries where each row from the first table is joined to every row in the second table (there are non-unique keys on both sides). The worst case output is the number of rows in the left table multiplied by the number of rows in the right table.
Common table expressions (CTEs) help you break up complex queries in BigQuery. Here's a simple query to illustrate how to write a CTE: with beta_users as ( select * from users where beta is true ) select events. * from events inner join beta_users on beta_users.id = events.
You should use a table alias. Try
SELECT member_group.User_Group,
member_group.Member_ID,
member_tran_year.MEMBER_UID
FROM [Dataset1.1_0_MEMBER_GROUP] as member_group
JOIN [Dataset1.1_4_MEMBER_TRAN_YEAR] as member_tran_year
ON member_group.Member_ID = member_tran_year.MEMBER_UID
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With