To implement multi-condition query, when the value is 0, it is unrestricted. How to use sql to achieve it
For example: when querying a certain type of store in a certain area, it is possible that the area is unlimited and the type is Chinese food. When querying, there is no need for where region = value, but only where type = Chinese food. When selecting the area as Beijing, the type is Chinese food. When querying, it is where region = Beijing. AND type=Chinese food.
Then there are many other conditions. It is too cumbersome to use if else to judge on the backend and then use different sql statements to query. I don’t know much about sql, but I think sql should have corresponding solutions. Please give me some advice.