1. 程式人生 > >[MySQL]獲取欄位中某個字元的個數

[MySQL]獲取欄位中某個字元的個數

例:獲取account_name欄位中‘_’的個數

select length(account_name) - length(REPLACE (account_name, '_', '')) 

from user