在pentaho数据集成上查询sql错误

时间:2013-12-24 07:24:19

标签: 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
    fact_flight.date_key = dim_date.date_key
GROUP BY
    dim_location.country_name

我们希望显示基于位置的日期名称,但它不起作用并发现错误:

  

#1054 - 未知栏' dim_date.date_key'在' on条款'

1 个答案:

答案 0 :(得分:0)

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

选择     dim_location.country_name,     COUNT(fact_flight.sk_fact) 从     dim_date,dim_location     INNER JOIN fact_flight ON dim_location.sk_location = fact_flight.sk_location 哪里     fact_flight.date_key = dim_date.date_key 通过...分组     dim_location.country_name;