I am facing some issue when I tried to fetch category_id from category column which having multiple values in it. I try to use Like clause but it doesn't work. This is what i tried
SELECT * FROM txz43_contact_details WHERE catid LIKE %18%
I am facing some issue when I tried to fetch category_id from category column which having multiple values in it. I try to use Like clause but it doesn't work. This is what i tried
SELECT * FROM txz43_contact_details WHERE catid LIKE %18%
You can use FIND_IN_SET()
SELECT *
FROM txz43_contact_details
WHERE FIND_IN_SET('18', catid) > 0
or
SELECT *
FROM txz43_contact_details
WHERE CONCAT(',', catid, ',') LIKE CONCAT('%,', '18', ',%')