How to translate this query to join? My MariaDB doesn't support IN and I cannot seem to write a proper query that uses JOIN and gives the same result. Here's the query with IN

SELECT * FROM topics WHERE topic_id IN 
( SELECT DISTINCT(topic) FROM answers 
ORDER BY date LIMIT 500 )


How would that query translate to something that doesn't use IN but JOIN (prefrably)?
You can use a correlated sub-query.

SELECT * 
FROM topics 
INNER JOIN
(SELECT DISTINCT(topic) as topic FROM answers LIMIT 500) x on x.topic = topic_id