从数据库sql中删除一个单词
16lz
2021-01-22
How can I delete one word from a MySQL database. For example, if I wanted to take a column of store names, and some end with "Inc", what query would remove the "Inc" from "Walmart Inc" for example to just leave it as Walmart?
如何从MySQL数据库中删除一个单词。例如,如果我想获取一列商店名称,有些以“Inc”结尾,那么什么查询会从“Walmart Inc”删除“Inc”,例如将其留作沃尔玛?
1 个解决方案
#1
0
If you want to remove 'inc' which is at last position
如果你想删除最后位置的'inc'
Update tbl set column= REPLACE(column ,'Inc',' ') where RIGHT(column,3) ='Inc'