Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Trying to do Left Outer Join BigQuery

I'm trying to do a relatively simple outer join but quite new to Big Query and I'm getting the following Error: internal error: missing closing bracket at: 2.3 - 2.39

SELECT
  ([130493328.ga_sessions_20170312].date),
  ([130493328.ga_sessions_20170312].total.visits),
  ([130493328.social].engagedUsers)
FROM ([130493328.ga_sessions_20170312]),
LEFT OUTER JOIN
  [130493328.social]
ON
  ([130493328.ga_sessions_20170312].date) = ([130493328.social].date);

Could someone let me know where I'm going wrong?

Thanks

like image 613
Aaron Harris Avatar asked Mar 03 '26 22:03

Aaron Harris


1 Answers

Try writing this with table aliases:

SELECT ga.date, ga.total.visits, s.engagedUsers
FROM [130493328.ga_sessions_20170312] ga LEFT OUTER JOIN
     [130493328.social] s
     ON ga.date = s.date;

You should also check if you are using Legacy SQL or Standard SQL. The square braces would not be appropriate in Standard SQL.

like image 78
Gordon Linoff Avatar answered Mar 05 '26 11:03

Gordon Linoff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!