DROP FUNCTION IF EXISTS pyremove;
CREATE FUNCTION pyremove(s TEXT,r TEXT)
RETURNS text
AS $$
global s
global r
lt=s.split(";")#将字符串根据分号拆分成列表
if r:
rt=r.split(";")
else :
rt=[]
for t in rt:
if t in lt:
lt.remove(t)
str=';'.join(lt)
return str
$$ LANGUAGE plpython3u;
UPDATE "Sheet1" SET "删除包含后"=pyremove(me_drug,"被包含");