double click advertising - BigQuery Match Table Lookup for DCM Data Transfer -


with dcm's data transfer v2 3 main tables of data in gcs:

  • p_activity_166401
  • p_click_166401
  • p_impression_166401

along plethora of match tables like:

  • p_match_table_advertisers_166401
  • p_match_table_campaigns_166401

table 1: p_activity_166401

row    | event_time    | user_id | advertiser_id  | campaign_id |  ------ | ------------- | ------- | -------------  | ----------- | 1      | 149423090566  | amsysza | 5487307        | 9638421     | 2      | 149424804284  | 2vmdsxs | 5487307        | 10498283    | 

table 2: p_match_table_advertisers_166401

row    | advertiser_id  | advertiser  |  ------ | -------------  | ----------- | 1      | 5487307        | company   | 2      | 5487457        | company b   | 

how reference value table 1 in table 2 , return value table 2 in query?

i'd result like:

row    | advertiser  | user_id     |  ------ | ----------  | ----------- | 1      | company   | amsysza     | 2      | company   | 2vmdsxs     | 

been searching around here , online , can't seem find clear reference on how lookups across table, apologies in advance simple thing i'm missing :)

edit nudge in right direction have found join function...

select   *   [dtftv2_sprt.p_activity_166401] inner join   [dtftv2_sprt.p_match_table_advertisers_166401] on   [p_activity_166401.advertiser_id] =   p_match_table_advertisers_166401.advertiser_id] limit   100; 

error: field 'p_activity_166401.advertiser_id' not found.

that field in table.

so query works great in creating view data in it.

select   *   [dtftv2_sprt.p_activity_166401] inner join   [dtftv2_sprt.p_match_table_advertisers_166401] on   dtftv2_sprt.p_activity_166401.advertiser_id = dtftv2_sprt.p_match_table_advertisers_166401.advertiser_id; 

using view can run smaller queries pull data want out. guiding me in right direction mikhail berlyant.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -