How can I to search in mysql within a table of comma-separated values?
I have a MySQL table which contains comma-separated values like 2,4,56,125
and i want to search record which have a particular value.
so how can i search in mysql
simple copy and paste this code in your table and change your table name and field name and search keyword.
SELECT * FROM table WHERE FIND_IN_SET(search_keyword , field_name)
like
SELECT * FROM tbl_font WHERE FIND_IN_SET(2,cat_id)
and i want to search record which have a particular value.
so how can i search in mysql
simple copy and paste this code in your table and change your table name and field name and search keyword.
SELECT * FROM table WHERE FIND_IN_SET(search_keyword , field_name)
like
SELECT * FROM tbl_font WHERE FIND_IN_SET(2,cat_id)
Comments
Post a Comment