My SQL isn’t the greatest, obviously, but what I’m trying to do is get the latest date in a database by finding the maximum year and month in an entry. Right now I have:
select max(Month), max(Year) from posts where postID = 25;
…but that results in the latest month and the latest year, though they’re not part of the same entry. How can I make sure month and year are from one entry and not separate?
SELECT Month, Year FROM posts WHERE postID = 25 ORDER BY Year DESC, Month DESC LIMIT 1