Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字段urn_sem.studentid,我想在其中替换几个字符;例如:
urn_sem.studentid
ABC/2011/BCOMH_NC/I/12
ABC/2011/BCOMH/I/12
ABC/2011/BCOMH_NC/I/24
ABC/2011/BCOMH/I/24
我试过这个查询:
SELECT REPLACE(studentid, 'KNC/2011/BCOMH_NC/', ' KNC/2011/BCOMH/') FROM urn_sem
但它没有显示新值。
你想要这个吗:
update urn_sem set studentid = REPLACE(studentid, 'KNC/2011/BCOMH_NC/', ' KNC/2011/BCOMH/') where studentid like '%KNC/2011/BCOMH_NC/%'
该WHERE子句是可选的。它确保替换仅在更改的行上。
WHERE
这个示例查询不起作用?从 urn_sem 中选择替换(学生编号,'_','')