-1

I have a table that contain following values separated by comma in column 'abc'.

(p,q,r,s,t)

I want to create a mysql select query that can fetch rows that matches any value from this subset. e:g if i want to fetch rows that with matching character 'p' then it should display that row which contains 'p' among one of the values.Any suggestions? I tried googling a lot but it didn't help me

Joachim Isaksson
  • 176,943
  • 25
  • 281
  • 294
user3848480
  • 15
  • 1
  • 2
  • 7

1 Answers1

2

You can use LIKE - e.g. select * from my_table where abc like '%q%' or abc like '%r%'

Ofir
  • 1,565
  • 3
  • 23
  • 41