我的ps_product_lang
表中有一千条记录。在此表中我有description_short
列。它包含一些描述。
问题
在某些行中,此描述在description_short
column.i中重复。我想检查description_short
列text.if列文本重复,如下所示,我想用正确的文本更新列。
例如:
ps_product_lang
表
+----------+----------------------------------------------+
| id | description_short |
+----------+----------------------------------------------+
| 1 | Lorem Ipsum is simply dummy text.Lorem Ipsum |
| | is simply dummy text. |
| 2 | Contrary to popular belief |
+----------+----------------------------------------------+
对于id = 1, Lorem Ipsum is simply dummy text.
重复。有没有办法检查并更新description_short
列。
答案 0 :(得分:0)
以下是REPLACE命令Link
的示例可以帮助您的示例:
SELECT id,description_short,
REPLACE(description_short,'Lorem Ipsum is simply dummy text.Lorem Ipsum is simply dummy text.','Lorem Ipsum is simply dummy text.')
FROM publisher
WHERE description_short='Lorem Ipsum is simply dummy text.Lorem Ipsum is simply dummy text.';