Mysql pentaho数据集成上的查询sql错误

Mysql pentaho数据集成上的查询sql错误,mysql,pentaho,Mysql,Pentaho,我的sql查询是 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_fact AND dim_date.date_key = fact_flight.date_key WHERE fa

我的sql查询是

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_fact AND 
    dim_date.date_key = fact_flight.date_key

WHERE
    fact_flight.date_key = dim_date.date_key
GROUP BY
    dim_location.country_name
我们希望显示基于位置的日期名称,但它不起作用,并查找错误:

1054-on子句中的未知列“dim_date.date_key”


请按照下面给出的查询重新排序FROM子句中的表

挑选 dim\u location.country\u name, COUNTfact_flight.sk_fact 从…起 标注日期、标注位置 dim_location.sk_location=事实_flight.sk_location上的内部连接事实_航班 哪里 事实\u flight.date\u key=dim\u date.date\u key 分组
dim_location.country_name

不要把遗留连接和新语法混为一谈。我看起来很熟悉:我几乎有似曾相识的感觉!谢谢你的回答,但当我希望基于结果的日期名称在数据库中。当我尝试查询数据库中不基于day_名称的结果时,如何解决这个问题?