2014-05-23 11 views
0

uniq的字符串我在DB有兩個柱IDDATA找到列在MySQL

ID | DATA                 
------------------------------------------------------------------------------- 
1 | Day by day ocean level is increasing because of global warming level 
2 | Modern email operates across the Internet or other computer networks 

注:level重複字row 1,我想只有一次。

在這裏,我想唯一字從DATA柱就像如下:

所需的輸出:提前

Day by ocean level is increasing because of global warming 

Modern email operates across the Internet or other computer networks 

謝謝..

+0

如何決定到哪個位置重複的單詞應該合併? –

+3

那麼,'日'和'日'是兩個字? –

+0

哦,真抱歉'一天'必須只有時間。 – learner

回答

0

我不知道,你能使用PHP。並不確定這種方法是否適合你。無論是這是一個解決方案..

使用sql query檢索data和使用PHP這樣

$text ="Day by day ocean level is increasing because of global warming level"; 
$str = implode(' ',array_unique(explode(' ', strtolower($text)))); 
echo ucfirst($str); 

結果治療data

Day by ocean level is increasing because of global warming