How to use GROUP BY and result with highest id value
For the one row with the highest ID:

ORDER BY ID DESC LIMIT 1


For the "latest" information associated with each subject, the problem is considerably more complex.  Search for "groupwise max".  Here's one link:
http://mysql.rjweb.org/doc.php/groupwise_max