gpt4 book ai didi

mysql - pentaho数据集成查询sql错误(子查询)

转载 作者:行者123 更新时间:2023-11-30 00:53:44 25 4
gpt4 key购买 nike

这是我的sql查询

SELECT 
p.Product_Name, d.year4
COUNT (fact_order.sk_product)
FROM
(SELECT * FROM fact_order limit 0,5000) fo , product p , dim_date d
WHERE fo.sk_product = p.sk_product and fo.sk_order_date = d.date_key and fo.sk_product = ${product_name}
GROUP BY fo.sk_product, d.year4
LIMIT 0,2000

我希望展示基于产品的年份

最佳答案

尝试

SELECT p.Product_Name, d.year4, COUNT(fo.sk_product)
FROM (SELECT * FROM fact_order limit 0, 5000) fo, product p, dim_date d
WHERE fo.sk_product = p.sk_product
and fo.sk_order_date = d.date_key
and fo.sk_product = ${product_name}
GROUP BY fo.sk_product, d.year4,p.Product_Name LIMIT 0, 2000

关于mysql - pentaho数据集成查询sql错误(子查询),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20758110/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com