2015-02-06 110 views
0

我有有三種不同的行下面的數據設置列的表:MySQL的模式匹配和替換

{{product.description}} 

{{user.email}} 

{{last_date}} 

我要追加字符串「|格式」與動態數據,輸出應該是這樣的

{{product.description | format}} 

{{user.email | format}} 

{{last_date | format}} 

我試圖與MySQL REPLACE()的方法,但問題是如何將這種指定模式匹配。

這是什麼將更新查詢?

回答

0
you can use the REGEXP operator as follows: 
SELECT (statement) REGEXP '{product.description}[.space.]|[.space.]format'; 

希望它有幫助。

+0

什麼是UPDATE查詢以獲得相應的輸出 – Arif 2015-02-06 06:42:36

+0

請檢查此鏈接。它有類似的問題和解決方案。 http://stackoverflow.com/questions/10465288/mysql-update-with-regexp – 2015-02-06 07:02:03