Take the case of two tables: tbl_product and tbl_transaction.
tbl_product lists product details including names and ids while
I found way to make LEFT JOIN with subquery, sorted and limited, its works on RDS Amazon, MariaDB v10.2
LEFT JOIN activities last_activity ON last_activity.id = (
SELECT id FROM activities
WHERE contester_id = contesters.id AND `type` IN ({$last_activity_types})
ORDER BY id DESC LIMIT 1
)
All others ways to make LEFT JOIN with GROUPING and SORTING didn't works for me. This example is working exception.