Does MySQL WHERE talk about parentheses the same way PHP does?

Is MySQL compatible with parentheses in WHERE clauses? Does it work like PHP where

WHERE (condition1 OR condition2) AND condition3

      

coincides with

if ((condition1 || condition2) && condition3)

      

+3


source to share


2 answers


Yes, it will work. I, for example, had something similar to this request in a project:



SELECT * FROM translation WHERE (language='en' AND translation_label='lbl_submit') OR (language='en' AND translation_label='lbl_submit_btn')

      

+2


source


Yes, they are calculated in the same way, although I'm not sure if they are in the same order.



+1


source







All Articles