**concat(‘添加的字符’,‘字符串2’,…)***函數
這個 函數主要是拼接用的
mysql concat(str1,str2,…) ,可以拼接多個函數
SELECT CONCAT('hello',',word!') str;結果爲:'hello,word!'
應用 concat(‘添加的字符’,‘數據庫列名’)用於修改數據庫某個字段,給某個字段前面都添加一個字符’/zfcg’
sql
update g2_t_attachment t set t.DOWNLOAD_URL=concat('/zfcg',t.DOWNLOAD_URL) WHERE t.DOWNLOAD_URL not LIKE '%zfcg%'
查詢不包含 zfcg的數據
SELECT * FROM g2_t_attachment t WHERE t.DOWNLOAD_URL not LIKE '%zfcg%'