[mythtv-users] Search phrase question

Raalph A raalph.a at gmail.com
Thu Feb 19 02:39:10 UTC 2009


Udo van den Heuvel wrote:
> Vincent Jorrand wrote:
>>> Do I need parentheses?
>>>
>>> ((channel.callsign = "NL1") OR
>>> (channel.callsign = "NL2") OR
>>> (channel.callsign = "NL3")) AND
>>> program.starttime < DATE_ADD( NOW( ) , INTERVAL 8 HOUR )
>>
>> As the AND has higher precedence than the OR, youneed at least:
>> (channel.callsign = "NL1" OR
>> channel.callsign = "NL2" OR
>> channel.callsign = "NL3") AND
>> program.starttime < DATE_ADD( NOW( ) , INTERVAL 8 HOUR )
>>
>> The extra parenthesis are not needed as = has higher precedence than 
>> OR (or AND)
>>
>> You can see the full precedence in mysql (which I believe is the same 
>> as the SQL standard) at:
>> http://dev.mysql.com/doc/refman/5.0/en/operator-precedence.html
>
> Thanks!
> With this info I can reduce 3 queries into one and lower the 
> scheduling load a tiny bit...
>
> Kind regards,
> Udo
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

I would think this works too:

channel.callsign IN ("NL1", "NL2", "NL3")
AND program.starttime < DATE_ADD( NOW( ) , INTERVAL 8 HOUR )



More information about the mythtv-users mailing list