我正在使用浏览器工具。
当我只是“运行查询”时,查询执行完美,但是当我启用选项并定义目标表时,我收到错误:
错误:record.subject.Equity_Code不是连接中任何一个表的字段 工作ID:robotic-weft-474:job_6IDQeNNhONJRttK6P-44a9rNqkE
以下是查询:
SELECT
IF(record.subject.Tax_ID=record.comp.Tax_ID,"subj","") as subj_comp,
record.subject.Tax_ID,
record.subject.Equity_Code,
comp_group.num_comps,
comp_group.median,
FROM
(
SELECT*
FROM
(
SELECT *
FROM [flat_file.dallas_flatfile]
WHERE
Assessed_Value>=1000000
AND Division_Code="COM"
AND Type_Code="OFFICE/SHOWROOM"
) as subject
JOIN EACH
(
SELECT *
FROM [flat_file.dallas_flatfile]
) as comp
ON subject.Equity_Code=comp.Equity_Code
) as record
JOIN EACH
(
SELECT
subject.Tax_ID,
count(distinct comp.Tax_ID) as num_comps,
NTH(50,QUANTILES(comp.Assessed_Value/comp.Equity_SQFT,101)) as median,
FROM
(
SELECT *
FROM [flat_file.dallas_flatfile]
WHERE
Assessed_Value>=1000000
AND Division_Code="COM"
AND Type_Code="OFFICE/SHOWROOM"
) as subject
JOIN EACH
(
SELECT *
FROM [flat_file.dallas_flatfile]
) as comp
ON subject.Equity_Code=comp.Equity_Code
WHERE NOT subject.Tax_ID=comp.Tax_ID
GROUP EACH BY subject.Tax_ID
) as comp_group
ON record.subject.Tax_ID=comp_group.subject.Tax_ID