Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


how to join two tables properly using -'google-bigquery'


how to join two tables properly  using -'google-bigquery'

I have two table which works perfectly on their own. Here I select all of my traffic sources which corresponds to userID 12 who purchased something on my homepage.

Select date, trafficSource.A, trafficSource.B, trafficSource.C,hits.transaction.BuyID
FROM (TABLE_DATE_RANGE([25.ga_sessions_],TIMESTAMP('2015-09-03'), TIMESTAMP('2015-09-03')))
Where hits.transaction.BuyID  = '12'


where I get:

trafficSource.A,trafficSource.B,trafficSource.C,hits.transaction.BuyID
    a                 b                 c            12


In my second table I select those traffic Sources meeting specific criteria:

SELECT trafficSource.A, trafficSource.B, trafficSource.C
FROM (TABLE_DATE_RANGE([25.ga_sessions_],TIMESTAMP('2015-09-03')
WHERE trafficSource.source = 'specific criteria'


Now I would like to produce a table which contains information about all BuyIDs and there corresponding traffic sources:

Select trafficSource.A, trafficSource.B, trafficSource.C,hits.transaction.BuyID
FROM (TABLE_DATE_RANGE([25.ga_sessions_],TIMESTAMP('2015-09-03'), TIMESTAMP('2015-09-03'))) AS result
JOIN (SELECT hits.transaction.BuyID
      FROM (TABLE_DATE_RANGE([25.ga_sessions_],TIMESTAMP('2015-09-03'), TIMESTAMP('2015-09-03'))))AS results
      ON result.hits.transaction.BuyID =results.hits.transaction.BuyID


getting:

Error: 0.0 - 0.0: Ambiguous field reference transaction.BuyID

query invalidQuery. 0.0 - 0.0: Ambiguous field reference transaction.BuyID

    

asked Sep 7, 2015 by rajesh
0 votes
2 views



Related Hot Questions



Government Jobs Opening


...