开发者

Oracle Column Value Modification

开发者 https://www.devze.com 2023-03-05 11:12 出处:网络
I am trying to fix an issue where some of the items in my table Documents Have a typo in one of the col开发者_高级运维umns

I am trying to fix an issue where some of the items in my table Documents Have a typo in one of the col开发者_高级运维umns

Where it should read Important: Please Read it instead reads ImportantPlease Read

I'm using not to good with Oracle, but how would I essentially do this

Update Documents Set Overview = "Imporantant: Please Read " + 
Overview.SubStr(19, Overview.Length) Where Overview Like 'ImportantPlease Read%'

Now I know this is nowhere near Oracle Syntax but I was wondering if you could help me fill in the gaps

Thanks in advance, and please let me know if you need further explanation.


You probably want

UPDATE documents
   SET overview = 'Important: Please Read ' || substr( overview, 19 )
 WHERE overview LIKE 'ImportantPlease Read%'


Try this:

UPDATE Documents
SET Overview = REPLACE(Overview, 'ImportantPlease', 'Important: Please')
WHERE Overview LIKE 'ImportantPlease%';
0

精彩评论

暂无评论...
验证码 换一张
取 消