List:General Discussion« Previous MessageNext Message »
From:Paul Halliday Date:October 12 2010 10:19am
Subject:Can this be done with a single query?
View as plain text  
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?

Thanks.
-- 
Paul Halliday
Ideation | Individualization | Learner | Achiever | Analytical
http://www.pintumbler.org

Thread
Can this be done with a single query?Paul Halliday12 Oct
  • Re: Can this be done with a single query?Nathan Sullivan12 Oct
  • Re: Can this be done with a single query?Johnny Withers12 Oct
    • Re: Can this be done with a single query?Paul Halliday12 Oct
      • RE: Can this be done with a single query?Travis Ard12 Oct
        • RE: Can this be done with a single query?Daevid Vincent13 Oct