With MySQL 4 it would be easy with subselects but here's a MySQL 3 way. It returns the userid and username of one user who has both made 15 posts and created one thread. I don't know how to modify it to use two other than using subselects (MySQL 4).
[sql]
SELECT u.username, u.userid FROM user u, thread t
WHERE u.posts > 15 AND t.postuserid = u.userid
ORDER BY RAND() LIMIT 1;
[/sql]
|