Ar Relalional Problem

Assume we have the following database tables:

post (id, internId[unique string])

post_data (id, postId, title, content, version[1,2,3,4…])

what is the best method to get a post with highest version of post_data?

or maybe there is a better approach, let me know

you can do a join query and then version in descending order you could limit it to 1