by now, i hope, you've gotten answers from the 
sql gurus on the list, so i won't clutter with my 
humble attempts.

your comment about problems with joins indicates 
that corereader might be of some help to you if 
you have a windows box for a front end.  it will 
let you do quick point-and-click queries, so you 
can experiment with fairly complex joins.

download it from http://corereader.com

it's intended to be a production system, but it's 
a great teaching tool.  it connects to anything, 
but it especially likes mysql.


> 
> Assume two tables:
> 
> CREATE TABLE block_ip (
>   datestamp int(11) NOT NULL default '0',
>   remote_addr char(15) NOT NULL default '',
>   PRIMARY KEY  (remote_addr),
>   KEY datestamp (datestamp)
> ) TYPE=MyISAM;
> 
> CREATE TABLE brute_force (
>   datestamp int(11) NOT NULL default '0',
>   remote_addr char(15) NOT NULL default '',
>   remote_user char(35) NOT NULL default '',
>   KEY remote_addr (remote_addr),
>   KEY datestamp (datestamp),
>   KEY remote_user (remote_user)
> ) TYPE=MyISAM;
> 
> Contents of the 'brute_force' table (remote_addr):
> 
> 1.2.3.4
> 2.3.4.5
> 3.4.5.6
> 4.5.6.7
> 5.6.7.8
> 6.7.8.9
> 
> Contents of the 'block_ip' table (remote_addr):
> 
> 2.3.4.5
> 4.5.6.7
> 
> Can someone help me with the query that will select all the
> 'remote_addr' rows from 'brute_force' that are NOT in the 'block_ip'
> table?
> 
> Something like:
> 
> select brute_force.* from brute_force, block_ip where
> brute_force.remote_addr != block_ip.remote_addr
> 
> maybe?  I have a feeling it's some sort of left join, and I was never
> very good at those.  :-/
> 
> 
> 



-- 
        John Ragan
        [EMAIL PROTECTED]
        http://www.CoreReader.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

Reply via email to