Alternative to LIKE clause in Mysql

后端 未结 3 1159
无人及你
无人及你 2021-01-13 06:45

I have got a filed in my database table which stores categories. I am storing the categories in the following format:

1,12,15

Now when I try to

3条回答
  •  不知归路
    2021-01-13 07:12

    You have a many to many relation between products and categories. You should create a new table to store the coresponding categories(cat_ids) for each product. You shouldn't have a column containing multiple category ids. This way your select would be much easier and a lot faster.

提交回复
热议问题