0

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.

GMB
  • 216,147
  • 25
  • 84
  • 135
Murali
  • 35
  • 5
  • 1
    By redesigning your table to adhere to normalisation conventions so that you can use the features of your RDBMS! Why are you storing skills in that way? – Asteroids With Wings Sep 24 '20 at 15:21

1 Answers1

1

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?

GMB
  • 216,147
  • 25
  • 84
  • 135