Re: Can this be done with a single query?

2010-10-12 Thread Nathan Sullivan
Paul, 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. Nathan On Tue, Oct 12, 2010 at 03:19:36AM -0700, Paul Halliday wrote: I have 2 tables: events and mappings. what I

Re: Can this be done with a single query?

2010-10-12 Thread Johnny Withers
I would try: SELECT DISTINCT(e.src_ip) FROM event AS e LEFT JOIN mappings AS m ON e.src_ip=m.src_ip WHERE e.timestamp BETWEEN '2010-10-11 00:00:00' AND '2010-10-12 00:00:00' AND INET_NTOA(e.src_ip) NOT LIKE '10.%.%.%' AND INET_NTOA(e.src_ip) NOT LIKE '172.16.%.%' AND INET_NTOA(e.src_ip) NOT LIKE

Re: Can this be done with a single query?

2010-10-12 Thread Paul Halliday
On Tue, Oct 12, 2010 at 11:14 AM, Johnny Withers joh...@pixelated.netwrote: I would try: SELECT DISTINCT(e.src_ip) FROM event AS e LEFT JOIN mappings AS m ON e.src_ip=m.src_ip WHERE e.timestamp BETWEEN '2010-10-11 00:00:00' AND '2010-10-12 00:00:00' AND INET_NTOA(e.src_ip) NOT LIKE

RE: Can this be done with a single query?

2010-10-12 Thread Travis Ard
IS NULL; -Travis -Original Message- From: Paul Halliday [mailto:paul.halli...@gmail.com] Sent: Tuesday, October 12, 2010 10:08 AM To: Johnny Withers Cc: mysql@lists.mysql.com Subject: Re: Can this be done with a single query? On Tue, Oct 12, 2010 at 11:14 AM, Johnny Withers joh

RE: Can this be done with a single query?

2010-10-12 Thread Daevid Vincent
'10.0.0.0' and '10.255.255.255' But yeah, Travis suggestion is cleaner and more efficient. -Original Message- From: Travis Ard [mailto:travis_...@hotmail.com] Sent: Tuesday, October 12, 2010 9:51 AM To: 'Paul Halliday' Cc: mysql@lists.mysql.com Subject: RE: Can this be done with a single

RE: Can this be done?

2002-02-13 Thread Rick Emery
What do your tables look like? Structure? What are you trying to do? What does your data look like? -Original Message- From: Ed Lazor [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 10, 2002 8:12 PM To: [EMAIL PROTECTED] Subject: Can this be done? I'm trying to update a database.

Re: Can this be done?

2001-12-08 Thread Steve Edberg
How about UPDATE myTable SET DueField = 0, StatusField = if(StatusField='O', 'C', StatusField) WHERE PrimaryKeyField = 'XYZXYZ' See http://www.mysql.com/doc/C/o/Control_flow_functions.html for more info on IF() function. -steve At 12:41

RE: Can this be done?

2001-12-07 Thread Johnson, Gregert
UPDATE myTable SET DueField = 0, StatusField = IF(StatusField = 'O', 'C', StatusField) WHERE PrimaryKeyField = XYZXYZ; -- Greg Johnson -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 1:42 PM To: [EMAIL PROTECTED] Subject: Can this be