I have a doubt, I must make a query to bring me the middle numbers that contain 0.8 or 5.
I used the command REGEXP
but it didn't work for me. It appears to me as null, in sql server it worked perfectly but with LIKE
SELECT autor_id
FROM autores
WHERE autor_id REGEXP '____[0,5,8]%';
If I understand correctly, you want those columns that contain
0
,5
u8
starting from the fourth character.In
REGEXP
MySQL the dot (.
) represents a single character. So this is how it should work:There it will search
0, 5 u 8
from the fourth character (that's why the four.
).See more details here .