select account_id,picture_id from pictures where account_id in (select account_id from accounts order by rand() limit 20) order by rand();
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]