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'

更多相关文章

  1. 仅在SQL Server数据库中显示包含3个单词的名称
  2. java 正则表达式查找某段字符串中所有小写字母开头的单词并统计

随机推荐

  1. PHP以正则表达式验证手机号码
  2. 如何实现php中date只显示年月日
  3. 如何解决php中fpm无法启动
  4. 如何解决php连接erp数据库失败
  5. 如何解决在php用gd库输出图片到微信浏览
  6. 详解PHP中php switch的方法实例
  7. 代码分析php中的回调函数
  8. PHP使用 is_numeric的实例解析
  9. PHP 使用 Trait 解决 PHP 单继承问题的实
  10. 详解PHP中password_hash的功能