How to store multiple values in single column where use less memory?

后端 未结 4 1489
滥情空心
滥情空心 2021-01-02 21:40

I have a table of users where 1 column stores user\'s \"roles\". We can assign multiple roles to particular user.

Then I want to store role IDs in

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-02 22:39

    You could do something like this

    INSERT INTO table (id, roles) VALUES ('', '2,3,4');
    

    Then to find it use FIND_IN_SET

提交回复
热议问题