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
Source of the problem As we all know, all network...
principle Set a shadow on the element when hoveri...
Preface Nodejs is a server-side language. During ...
Preface Let’s take a look at the final effect fir...
Several concepts Line box: A box that wraps an in...
1. In IE, if relative positioning is used, that is...
Table of contents 1: Introduction to galera-clust...
background When we talk about transactions, every...
Table of contents Preliminary Notes Problem Repro...
It has been three or four months since I joined Wo...
Table of contents nextTick v-model syntax sugar ....
1. First, the pure HTML file must have an entry i...
I want to make a docker for cron scheduled tasks ...
(When a web page is loading, sometimes there is t...
rm Command The rm command is a command that most ...