Recruiter list,Employer List,Latest Jobs,Intrested Recruiter,Recruiter Resume,Shortlisted Hr Resume
UPDATE assign SET menu=REPLACE(REPLACE(CONCAT(',', menu, ','), 'Shortlisted Hr Resume', ''), ',,', ',') WHERE hr_id='hr2911025540'
在这种情况下,我有一个字符串Recruiter List, Shortlisted Hr Resume, Add Hr
。现在,我只想删除Shortlisted Hr Resume
,但是此查询替换结尾和输出中的值都像,Employer List,Latest Jobs,Intrested Recruiter,Recruiter Resume,
一样,那我该怎么做,请帮帮我吗?
谢谢
答案 0 :(得分:0)
UPDATE groups
SET
description =
TRIM(BOTH ',' FROM REPLACE(CONCAT(',', description, ','), ', Shortlisted Hr Resume,', ','))
WHERE id='1'
您也可以
UPDATE yourtable
SET
description =
TRIM(BOTH ',' FROM
REPLACE(
REPLACE(CONCAT(',',REPLACE(col, ',', ',,'), ','),',2,', ''), ',,', ',')
)
WHERE
FIND_IN_SET('2', description)