I have a mysql select query to retrieve schedule information based on baseline, city of origin, country of destination and city of destination. In my query, I used the AND and OR operator.
Here is my request
SELECT * FROM TruckLoadSchedule ts WHERE ts.originState IN (states) AND ts.originCity IN (cities) OR ts.destState IN (states) AND ts.destCity IN (cities);
But I need to know the priority of the AND and OR operator in the above query, I want to say that it will do something like this (X AND Y) OR (M AND Q) internally?
mysql operator-precedence
Kishan_KP
source share