comma separated value separation

后端 未结 4 1161
长发绾君心
长发绾君心 2021-02-06 11:47

I have one table with the following kinds of records in it. I have Salesman and associated account numbers (comma separated).

+----------+----------         


        
4条回答
  •  面向向阳花
    2021-02-06 12:43

    I assume that you need this just as a one-off operation in order to restructure your schema into something usable.

    Do you have another table which lists all the possible account numbers? If you do then you can do this:

    SELECT salesman, a.Acct
    FROM account AS a
    JOIN salesman_account AS sa
    ON FIND_IN_SET(a.Acct, sa.Acct)
    

提交回复
热议问题