please find the below
https://www.db-fiddle.com/f/oDs9VD1T7ScSimA4RHwmzN/1
Hi, if you open the fiddle, i added test data,
Basically, the end result i am trying to get is, only one row from each custome_id order by last_updated and communication_id =1 Example Bellow Query gives all record order by updated_at DESC, but i need to extend it so that it works "Group by Customer_id" id and only show one row for each customer.
SELECT diary,customer_id,updated_at FROM
test
where communication_type_id=1 ORDER BY updated_at DESC;
the required result will be like this mark in bellow link
[https://ibb.co/qNJdsbb][1]
hope it make sense.
mysql version mysql Ver 8.0.21-0ubuntu0.20.04.4 for Linux on x86_64 ((Ubuntu))