去掉換行符和回車符
UPDATE table SET field = REPLACE(REPLACE(field , CHAR(10), ‘’), CHAR(13), ‘’);
ids修改爲32位隨機字符
update table set ids = replace(UUID(), ‘-’, ‘’) where length(ids) < 32
關聯修改時,若爲空,則不修改
update account a set a.person_id = IFNULL((select b.ids from person b where a.person_id = b.ids ), a.person_id )
將查詢到的一列數據合併成字符串
select a.
id
序號, a.name
姓名, GROUP_CONCAT(b.account
separator ‘;’) 賬號
from person a, account b
where 1 = 1
and a.ids = b.person_id
GROUP BY a.ids;