Code:
select id from db_table where category in('','5')
This code will match against the
entire`category` field,
not just part of it. I assume from that example data that your `category` fields contains one
or more category numbers separated by spaces.
I would use something like the following:
Code:
Select id From db_table Where category REGEXP "(^| )(5)( |$)"
If you want to select categories 5, 2 and 3, you can then do:
Code:
Select id From db_table Where category REGEXP "(^| )(5|2|3)( |$)"
I suggest you read carefully the SELECT function details in the MySQL manual.