4

I've a table row where the values looks like below.

Table Name: Movies
Row name: Genere

Row 1 Action,Crime,Thriller
Row 2 Adventure
Row 3 Mystery,Thriller

SELECT * FROM  `Movies` WHERE  `Genere` IN ('thriller',  'animation');                

But the values are not fetching eventhough the word thriller exists.

1) Is the way I saved in MySQL table in phpMyAdmin correct?
2) How to access second or third values using IN?

Armali
  • 18,255
  • 14
  • 57
  • 171

1 Answers1

1

Try this:

SELECT * FROM  `Movies` WHERE FIND_IN_SET( 'thriller', `Genere`) 
                           OR FIND_IN_SET( 'animation', `Genere`) 
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331