Query Error: Improper usage of GROUP BY clause.
When I execute a query made and stored six months ago I get the following error:
"Please ensure that all the non aggregate columns used in the SELECT clause is also used in GROUP BY clause."
The query is saved which is why the error most be due to changes you made in the past 6 months.
Could you please help me solve this problem. My Query Table looks like this:
------------
select customer_id,timestamp(max(created_at)),firstname,lastname,company,sales_responsible_uk,sales_responsible,store_name, ISNULL(Orders_New.row_invoiced,'-1'), status, coupon_code, region, city, customer_email, phone_number, telephone, telephone1
from Orders_New
where (status = 'processing' OR status = 'complete')
AND ((coupon_code NOT IN 'free')
OR coupon_code IS NULL)
group by customer_id
order by customer_id, created_at desc
------------