【问题标题】:mysql truncate column data with specific text [duplicate]mysql用特定文本截断列数据[重复]
【发布时间】:2019-06-10 09:43:11
【问题描述】:

我有一个mysql表客户,列参考。 1000行数据

有很多参考数据。 '客户信用票据 XXXXX' 我想用 '' 替换 'Customer credit note'

我该怎么做?

【问题讨论】:

标签: mysql


【解决方案1】:

要更正表中的数据,请使用 REPLACE 更新它们

UPDATE customer 
SET reference = REPLACE(reference, 'Customer credit note ', '')
WHERE reference LIKE 'Customer credit note %';

【讨论】:

  • 复制它会更好
猜你喜欢
  • 1970-01-01
  • 2021-09-10
  • 2014-08-26
  • 1970-01-01
  • 1970-01-01
  • 2013-10-14
  • 1970-01-01
  • 2013-03-02
  • 1970-01-01
相关资源
最近更新 更多