我有一张员工表
EmpGid Employees
1 john
2 john,kevin
3 Tom,Peter,harry
4 Peter,Mike,Frank
当我选择员工时,我需要输出如下所示
Employees
john
john','kevin
Tom','Peter','harry
Peter','Mike','Frank
I am using Replace but i am unable replace ',' where , is present .
Can some one help me how to replace.
答案 0 :(得分:1)
这将替换为',':
SELECT *, replace(Employees, ',',''',''') FROM Employees
答案 1 :(得分:1)
应该是
select REPLACE('John,Kevin',',',''',''')
这将导致John','Kevin