Вот этот скул запрос (стандартный)
Код: Выделить всё
SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time FROM aerob_topics t, aerob_users u, aerob_posts p, aerob_posts p2, aerob_users u2 WHERE t.forum_id = 20 AND t.topic_poster = u.user_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id AND t.topic_type <> 2 ORDER BY t.topic_type DESC, t.topic_last_post_id DESC LIMIT 0, 22