pentaho 数据集成 (cdb) 上的错误查询 mysql [英] error query mysql on pentaho data integration (cdb)

查看:47
本文介绍了pentaho 数据集成 (cdb) 上的错误查询 mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

but it's doesn't work and this is error message

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

推荐答案

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

Please re-order the tables in the FROM clause as in the query given below; otherwise, the join condition in the ON clause that is meant to be applied to joining the dim_location and fact_flight tables, will be wrongly applied to the dim_date and fact_flight tables which would result in the above error:

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

这篇关于pentaho 数据集成 (cdb) 上的错误查询 mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆