【问题标题】:error query mysql on pentaho data integration (cdb)pentaho 数据集成 (cdb) 上的错误查询 mysql
【发布时间】:2013-12-24 06:58:54
【问题描述】:

mysql查询是:

SELECT
    dim_location.country_name,
    COUNT(fact_flight.sk_fact)
FROM
    dim_location, dim_date
    INNER JOIN fact_flight ON dim_location.sk_location = fact_flight.sk_location
WHERE
    fact_flight.date_key = dim_date.date_key
GROUP BY
    dim_location.country_name

但它不起作用,这是错误消息

#1054 - Unknown column 'dim_location.sk_location' in 'on clause'

【问题讨论】:

    标签: mysql pentaho


    【解决方案1】:

    请按照下面给出的查询重新排序 FROM 子句中的表;否则,用于连接dim_locationfact_flight 表的ON 子句中的连接条件将错误地应用于dim_datefact_flight 表,这将导致上述错误:

    SELECT
        dim_location.country_name,
        COUNT(fact_flight.sk_fact)
    FROM
        dim_date, dim_location
        INNER JOIN fact_flight ON dim_location.sk_location = fact_flight.sk_location
    WHERE
        fact_flight.date_key = dim_date.date_key
    GROUP BY
        dim_location.country_name
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-30
      • 2017-02-27
      • 1970-01-01
      • 1970-01-01
      • 2015-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多