MySQL Forums
Forum List  »  General

Re: Retrieving latest dates grouped by a key column value
Posted by: Jörg Büchner
Date: December 03, 2022 04:04AM

All credit goes to Zachary Dionne.

SELECT id, date, subNo
FROM myTable
WHERE poNo=800 AND (date, subNo) IN(
SELECT MAX(date), subNo
FROM myTable
WHERE poNo=800
GROUP BY subNo)
GROUP BY subNo
ORDER BY subNo

Options: ReplyQuote


Subject
Written By
Posted
Re: Retrieving latest dates grouped by a key column value
December 03, 2022 04:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.