I think you could accomplish this by adding a subquery to your where clause, like:
AND NOT EXISTS (SELECT * FROM mappings m where m.src_ip=src_ip)
Hope that helps.
On Tue, Oct 12, 2010 at 03:19:36AM -0700, Paul Halliday wrote:
> I have 2 tables: events and mappings.
> what I want to do is something like:
> SELECT DISTINCT(src_ip) FROM event WHERE timestamp BETWEEN '2010-10-11
> 00:00:00' AND '2010-10-12 00:00:00' AND INET_NTOA(src_ip) NOT LIKE
> '10.%.%.%' AND INET_NTOA(src_ip) NOT LIKE '172.16.%.%' AND INET_NTOA(src_ip)
> NOT LIKE '192.168.%.%';
> but, within that somewhere also check to see if src_ip exists in mappings.
> If it does, do not return it.
> Is this possible?
> Paul Halliday
> Ideation | Individualization | Learner | Achiever | Analytical