【无标题】mysql 截取两个,之间字符串

截取两个,之间字符串

select area,SUBSTRING_INDEX(et.area,',',1) as XZQH1,if(length(et.area)-length(replace(et.area,',',''))>=1,SUBSTRING_INDEX(SUBSTRING_INDEX(et.area,',',2),',',-1),NULL) AS XZQH2,if(length(et.area)-length(replace(et.area,',',''))>=2,SUBSTRING_INDEX(et.area,',',-1),NULL) AS XZQH from et_base_info as et ;

【无标题】mysql 截取两个,之间字符串_第1张图片

你可能感兴趣的:(sql,mysql,android,数据库)