( SELECT referenced_tables.dataset_id as referenced_table_dataset_id ,referenced_tables.table_id as referenced_table_table_id ,destination_table.dataset_id as destination_table_dataset_id ,destination_table.table_id as destination_table_table_id FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION JOIN UNNEST(referenced_tables) AS referenced_tables WHERE DATE(creation_time, "Asia/Tokyo") >= DATE_SUB(CURRENT_DATE("Asia/Tokyo"), INTERVAL 90 DAY) AND DATE(creation_time, "Asia/Tokyo") <= DATE_SUB(CURRENT_DATE("Asia/Tokyo"), INTERVAL 1 DAY) ) ,nest1 AS ( SELECT DISTINCT "nest1" AS nest_level ,destination_table_dataset_id ,destination_table_table_id FROM table_jobs_meta WHERE referenced_table_table_id = 'SOME_TABLE' AND (referenced_table_dataset_id, referenced_table_table_id) != (destination_table_dataset_id, destination_table_table_id) --自己参照除外 ) ,nest2 AS ( SELECT DISTINCT "nest2" AS nest_level ,destination_table_dataset_id ,destination_table_table_id FROM table_jobs_meta WHERE (referenced_table_dataset_id, referenced_table_table_id) IN (SELECT (T1.destination_table_dataset_id, T1.destination_table_table_id) FROM nest1 AS T1) AND (referenced_table_dataset_id, referenced_table_table_id) != (destination_table_dataset_id, destination_table_table_id) --自己参照除外 AND (destination_table_dataset_id, destination_table_table_id) NOT IN (SELECT (T1.destination_table_dataset_id, T1.destination_table_table_id) FROM nest1 AS T1) ), nest3 AS ... 後続データマート調査クエリの一部(JOBS ビューから取得)