Jump to content

Matching Criterion


chaking

Recommended Posts

I'm trying to match a few things here and I'm getting a little confused - any help would be appreciated:

 

$s = "SELECT DISTINCT DEVID, INPUTDEVID, MACHINE FROM EVENTS WHERE (EVENT_TIME_UTC BETWEEN '".$start."' AND '".$end."') AND ((EVENTTYPE = 0 AND EVENTID = 0) OR (EVENTTYPE = 4 AND EVENTID IN (2,8,10,53,413,431))) AND (MACHINE = ".$machine.")";

 

So I'm trying to find any event that has an eventtype of 0 AND an eventid of 0... OR any eventtype of 4 and eventid in (2,8,10,53,413,431).  I do NOT want an eventtype of 4 and an eventid of 0.  I'm getting a bit confused on how to convey this in the sql statement.  I thought I could separate it with parentheses and that would do the trick, but I'm not so sure

 

Any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/201435-matching-criterion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.