[mythtv-users] Search phrase question
Udo van den Heuvel
udovdh at xs4all.nl
Wed Feb 18 19:25:28 UTC 2009
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
More information about the mythtv-users
mailing list