select t.customer_id ,t1.customer_name ,t2.product_name as latest_order from orders t join customers t1 on t.customer_id=t1.customer_id join products t2 on t.product_id=t2.product_id where order_date=(select max(order_date) from orders t3 where t.customer_id=t3.customer_id group by customer_id) order by t.customer_id



京公网安备 11010502036488号