-2

I have this table

item_ids

id  | items
---------------------------
 1  | 12, 42, 71, 3
 2  | 64, 13, 52, 7, 1
 3  | 1, 5, 8, 10, 16

I will like to search for the record that has exact match as the user entered. for instance. if a user enters the number "7" the result be item with id "2" (64, 13, 52, 7, 1) and NOT item with id of "1" (12, 42, 71, 3) although it contains 7 in the "71".

Thank you.

I have already had a look of This and it is not the same as what I want.

the values of "Items"(numbers) are NOT for relational purpose, thanks.

Community
  • 1
  • 1
David Addoteye
  • 1,587
  • 1
  • 19
  • 31

1 Answers1

0

You can try this :

SELECT id FROM item_ids WHERE items LIKE "% 7 %";