I have a Table 'Notification_details' where I query to obtain the unique records with the following MySQL query

select userid, max(notification_date) as notification_date from notification_details group by userid order by notification_date asc
Which gives the result, where the userid is unique and the notification_date is the latest( max). Now, I would like to extend the MySQL command to query between 2 dates of the result I have obtained :

Any idea, how to extend the above MySQL command ?
If I didn't missunderstand you:
SELECT alias.*
FROM (select userid, max(notification_date) as notification_date from notification_details group by userid order by notification_date asc) alias
WHERE alias.notification_date BETWEEN DATE1 AND DATE2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With