SQlite query to update column and replace a value

前端 未结 2 1630
说谎
说谎 2021-01-23 11:25

I want to update a column that contains a string like 12,43,433 I want to only replace 43 with another number say 54 so that the column value becomes 12,54,433.

How can

2条回答
  •  臣服心动
    2021-01-23 11:54

    You can use REPLACE() function like this:

    UPDATE YourTable a
    SET a.StringColumn = REPLACE(a.StringColumn,',43,',',54,')
    WHERE a.StringColumn like '%,43,%'
    

提交回复
热议问题