2017-09-19 19 views
0

我在我的ps_product_lang表中有一千條記錄。在此表中,我有description_short column.it包含一些說明。如何檢查單個列中的重複文本mysql

問題 在某些行,這說明在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     | 
+----------+----------------------------------------------+ 

Lorem Ipsum is simply dummy text.是重複的ID = 1.is有沒有辦法進行檢查,並更新description_short列。

回答

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.';