I have a candidate table. Within that, I have a column named skills. It's storing multiple values with a delimiter. Now I want to create a search filter including skills. How can I do this?
Thank you in advance.
I have a candidate table. Within that, I have a column named skills. It's storing multiple values with a delimiter. Now I want to create a search filter including skills. How can I do this?
Thank you in advance.
In MySQL, one option uses find_in_set()
:
select * from candidates where find_in_set(?, skills)
?
represents the skill that you search for.
That said, a far better option would be to normalize your schema. You should not be storing multiple values in a single column. Instead, you should have a separate table to store the relationships between candidates and skills, with each candidate/skill tuple on a separate row.
Recommended reading: Is storing a delimited list in a database column really that bad?