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
答案 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
中。