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
  • 16,557
  • 13
  • 53
  • 152

1 Answers1

1

Try this:

SELECT * FROM  `Movies` WHERE FIND_IN_SET( 'thriller', `Genere`) 
                           OR FIND_IN_SET( 'animation', `Genere`) 
Rahul Tripathi
  • 161,154
  • 30
  • 262
  • 319