mysql SUBSTRING_INDEX

  mysql
SELECT hi.houseCode,SUBSTRING_INDEX(hi.houseCode,'-',1) AS lou,SUBSTRING_INDEX(SUBSTRING_INDEX(hi.houseCode,'-',2),'-',-1) AS men,SUBSTRING_INDEX(hi.houseCode,'-',-1) AS fang FROM houseinfo hi

clipboard.png