I have a query that selects groups and group postings. In the postings table there is a timestamp collumn, and a group_id. I need to select the greatest timestamp in the postings table, associated with the group id.
Here's my query
$query = "
SELECT groups.group_name, groups.group_info, groups.group_tags, postings.timestamp
FROM groups
LEFT JOIN postings ON groups.group_id = postings.group_id
GROUP BY groups.group_id
ORDER BY `postings`.`timestamp` DESC
";