Du löser det med en inner-sql fråga, samt group-by funktionen min:
select threads.timestamp, posts.subject, posts.post_id, threads.thread_id from threads, posts where threads.thread_id = posts.thread_id and forum_id = '2' and posts.id in (select min(id) from posts group by thread_id) order by threads.timestamp desc;
Eftersom jag inte har tillgång till din db, får du se det som pseudo-kod