gpt4 book ai didi

mysql - 我在 Mysql 的查询中编写了这个查询,但它在 Hive 中不起作用。它向我显示一个错误

转载 作者:行者123 更新时间:2023-11-29 16:18:53 25 4
gpt4 key购买 nike

select c.customer_id,concat(c.customer_fname,' ',c.customer_lname) as fullname, o.order_customer_id,o.order_status from 
customers c left outer join orders o on (c.customer_id = o.order_customer_id)
group by o.order_status

最佳答案

您可以尝试以下查询:

select 
c.customer_id,
concat(c.customer_fname,' ',c.customer_lname) as fullname,
o.order_customer_id,
o.order_status
from
customers c left outer join orders o on (c.customer_id = o.order_customer_id)
group by c.customer_id,concat(c.customer_fname,' ',c.customer_lname),o.order_customer_id, o.order_status

正如其他 stackies 已经建议的那样,您的 group by 语句中缺少列。所有非聚合列应包含在 group by 中。

关于mysql - 我在 Mysql 的查询中编写了这个查询,但它在 Hive 中不起作用。它向我显示一个错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54624498/

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