mysql 字符串截取1.从左开始截取字符串left(str,length)被截取字段,截取长度select left('admin1213',5) from table 2.从右开始截取字符串right(str,length)被截取字段,截取长度select right('admin1213',5) from table3.截取字符串substring(str,pos)被截取字段,从第几位截取select substring('admin1213',5) from table substrin…
#select SUBSTRING_INDEX('1,2', ',', 1); SELECT * FROM dis_disease WHERE id = ( SELECT SUBSTRING_INDEX(t.disease_ids, ',', 1) FROM crm_diagnosis t WHERE t.id = 547 ) disease_ids 1,2,3,4…