BigQuery没有运行MySQL查询 - 错误“遇到”“在第17行第2列。”

时间:2016-11-01 18:33:05

标签: google-bigquery

我运行以下查询并收到错误:

  

“遇到”“第17行,第2栏。”

SQL查询在MySQL中运行,但在BigQuery中不运行。我该如何解决这个问题?

SELECT
  vtbl_co.id,
  tbl_co.ypname,
  tbl_co.ypwww,
  tbl_co_1.ypname AS compname,
  tbl_co_1.ypwww,
  tbl_comps.dist,
  tbl_stats_1.grain_count,
  tbl_stats_1.grain_images,
  tbl_stats_1.grain_dq,
  tbl_stats.grain_count AS compgrainct,
  tbl_stats.grain_images AS compgrainimg,
  tbl_stats.grain_dq
FROM
  tbl_stats AS tbl_stats_1
RIGHT JOIN (((
(tbl_comps
        INNER JOIN
          tbl_co
        ON
          tbl_comps.idk_prospect = tbl_co.id)
      INNER JOIN
        tbl_co AS tbl_co_1
      ON
        tbl_comps.idk_peer = tbl_co_1.id)
    LEFT JOIN (tbl_stats
      RIGHT JOIN
        tbl_url
      ON
        tbl_stats.id_url = tbl_url.id)
    ON
      tbl_co_1.id_url = tbl_url.id)
  LEFT JOIN
    tbl_url AS tbl_url_1
  ON
    tbl_co.id_url = tbl_url_1.id)
ON
  tbl_stats_1.id_url = tbl_url_1.id

1 个答案:

答案 0 :(得分:1)

如果要在JOIN来源周围括起括号,则需要将JOIN来源设为子选择的结果,例如:

[...]
FROM
  tbl_stats AS tbl_stats_1
RIGHT JOIN (((
(SELECT [...]
 FROM tbl_comps
    INNER JOIN
      tbl_co
[...]