Today, there is such a requirement. If the logged-in person is a customer service representative, the order will be queried for "this customer service representative" and the orders that have not been matched with a customer service representative. At first, I thought of spelling "or assigned_id is null" directly in the SQL statement. After testing, I found that in this case, the other previous conditions are useless. In this case, the first condition i.server_org_id = 4 is no longer applicable. From this we can see that AND has a higher priority than OR. The previous AND statement is executed first, and then the following OR statement is executed. Therefore, the data retrieved is not the data I want. Later I thought about it again and found that I could first find out the corresponding assigned_id, as follows The only data found in this way is the assigned_id 153 Final version: Finally, all the correct data is read out. From this, we can see that () has a higher priority than AND. () is executed first, and then AND is executed. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
>>: Summary of practical skills commonly used in Vue projects
1. Command Introduction The usermod (user modify)...
Nginx is configured with the same domain name, wh...
1. Why set maxPostSize? The tomcat container has ...
This article example shares the specific code of ...
Download CentOS7 The image I downloaded is CentOS...
Table of contents Preface Is the interviewer aski...
1. Performance schema: Introduction In MySQL 5.7,...
Table of contents Intro Nginx Dockerfile New conf...
I didn't intend to write this blog, but durin...
Table of contents JS Three Mountains Synchronous ...
Develop a number guessing game that randomly sele...
Purpose: 1. In order to map the server's exte...
There are two types of html tags, inline elements...
Recently, I ran a spark streaming program in a ha...
Table of contents 1. Commonly used string functio...