Then this should work. SELECT remote_user, substring_index(remote_host,'.',3) AS ip_subnet FROM password_log LEFT JOIN exclude_log ON substring_index(password_log.remote_host,'.',3) = exclude_log.ip_block WHERE remote_user != '-' AND status=200 AND ip_block IS NULL GROUP BY ip_subnet ORDER BY remote_user, ip_subnet
--- Eric Anderson <[EMAIL PROTECTED]> wrote: > > I don't remeber if MySQL allows subselects, but > try > > this. > > > > SELECT remote_user, > substring_index(remote_host,'.',3) > > AS ip_subnet > > FROM password_log > > WHERE remote_user != '-' AND status=200 AND > > substring_index(remote_host,'.',3) NOT IN > > (SELECT ip_block FROM exclude_log) > > GROUP BY ip_subnet > > ORDER BY remote_user, ip_subnet > > No sub-selects. :-/ > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php