AS (SELECT DATE( ‘2018-12-01’ –データ期間の開始日 ) AS sdt), enddt AS (SELECT DATE( ‘2019-01-08’ –データ期間の終了日 ) AS edt), ------------------------------------------------------------------------------ -- 2. 【ここはいじらなくて大丈夫です】データ作成 ------------------------------------------------------------------------------ log AS (SELECT DATE(CAST(FORMAT_TIMESTAMP('%Y-%m-%d %H:%M:%S', TIMESTAMP_SECONDS(time), 'Asia/Tokyo') AS TIMESTAMP)) AS dt, * FROM `project.adlog` WHERE DATE(_PARTITIONTIME) BETWEEN (SELECT DATE(TIMESTAMP_ADD(CAST(sdt AS TIMESTAMP), INTERVAL -1 DAY)) FROM startdt) AND (SELECT * FROM enddt) ), 33 / 58
A.id1 = dss.id1 AND A.id2 = dss.id2 AND A.id4 = dss.id4 AND A.id5 = dss.id5 LEFT JOIN `project.master1` B ON A.id6 = B.id6 LEFT JOIN `project.master2` C ON A.id7 = C. id7 LEFT JOIN `project.master3` D ON C.id8 = D.id8 LEFT JOIN `project.master4` cr ON A.id9 = cr.id9 LEFT JOIN `project.master5` cpm ON A.id10 = cpm.id10 LEFT JOIN `project.master6` ag ON A.id11 = ag.id11 LEFT JOIN `project.master7` adbra ON A.id12 = adbra.id12 LEFT JOIN `project.master8` ch ON A.id13 = ch.id13 LEFT JOIN `project.master9` v_ch ON D.video_id13 = v_ch.id13 LEFT JOIN `project.master10` cp ON A.id1 = cp.id1 LEFT JOIN `project.master11` cluster ON A.id14 = cluster.id14 LEFT JOIN `project.master12` conp ON A.id15 = conp.id15 LEFT JOIN `project.master13` sl ON A.id16 = sl.id16 LEFT JOIN `project.master14` sli ON A.id16 = sli.id17 LEFT JOIN `project.master15` ps ON ps.id7 = A.id7 AND ps.id16 = A.id16 34 / 58