I have the following values โโin my sql column: -
a,b,c,de,f
I want to check if column b present.
b
You can use FIND_IN_SET () :
FIND_IN_SET('b',yourcolumn) > 0
As an example, which will be used in the request:
SELECT * FROM yourtable WHERE FIND_IN_SET('b',yourcolumn) > 0;
you can use FIND_IN_SET ()
FIND_IN_SET('a','a,b,c,d,e');
http://www.w3resource.com/mysql/string-functions/mysql-find_in_set-function.php
You can use a similar sentence in a column, for example, if the column name contains these values โโin the users table, you can use this query
select * from users where name like "%b%";
Try the following:
select * from users where name like "%,b,%" OR name like "b,%" OR name like "%,b" ;