How to replace comma separated department ids with their name respectively?

前端 未结 2 1979
长发绾君心
长发绾君心 2021-01-16 19:22

My tables are these :

Employee Table:

+-----------+----------+------------+
| id       | name     | department  |
+-----------+----------+-----------         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 20:08

    SELECT replace(replace(department,'1','CS'),'2','IT')  as dept  from Employee
    

提交回复
热议问题