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
------------