Home > database >  Permissions field power has similar 1,2,3,4,5,6,7,8,9 string, how to find out in the powe contains 2
Permissions field power has similar 1,2,3,4,5,6,7,8,9 string, how to find out in the powe contains 2

Time:09-24

Permissions field power has similar 1,2,3,4,5,6,7,8,9 string, how to find out in the powe contains 2 and 5 and 8 data at the same time?

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 structure
Such as schedule of power

CodePudding user response:

Don't know how to use regular effect, can try
 where power REGEXP '. *, 2,. *, 5,. *, 8,. * '; 

* match zero or more characters