There are a lot of users, for example, permissions field power is like 1,2,3,4,5,6,7,8,9 string rights
Now I want to find out at the same time there are three user permissions, such as at the same time there are 2 and 5 and 8 three user
How to quickly find a SQL statement?
Now use the where (find_in_set (2, power) and find_in_set (5, power) and find_in_set (8, power))
Feeling is not very high efficiency! Is there a high efficiency way?
CodePudding user response:
High efficiency may need to change the structureSuch as schedule of power
CodePudding user response:
Don't know how to use regular effect, can trywhere power REGEXP '. *, 2,. *, 5,. *, 8,. * ';
* match zero or more characters