我在Mysql中的查询中编写了此查询,但在Hive中不起作用。告诉我一个错误

时间:2019-02-11 05:37:00

标签: mysql hive

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

1 个答案:

答案 0 :(得分:0)

您可以尝试以下查询:

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

正如其他堆栈建议那样,您在group by语句中缺少列。所有未聚合的列都应包含在group by中。