2017-09-19 5 views
0

Ich habe tausend Datensätze in meiner ps_product_lang Tabelle. In dieser Tabelle habe ich description_short column.it enthalten einige Beschreibungen.So überprüfen Sie doppelten Text in einer einzigen Spalte mysql

Problem in einigen Zeilen, diese Beschreibung in description_short column.i dupliziert will description_short Spalt text.if Spaltentext wie unten duplizieren überprüfen, ich will Spalte mit korrektem Text aktualisieren.

zB: ps_product_lang Tabelle

+----------+----------------------------------------------+ 
| 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. für id dupliziert = 1.Is es eine Möglichkeit, es zu überprüfen und description_short Spalte zu aktualisieren.

Antwort

0

Heres ein Beispiel für die REPLACE-Befehl Link

Beispiel die Ihnen helfen können:

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