./categories/server
MySQL 전화번호 문자열 분리 (SUBSTRING_INDEX)
SELECT
SUBSTRING_INDEX('010-1234-5678','-',1) AS tel1,
SUBSTRING_INDEX(SUBSTRING_INDEX('010-1234-5678','-',-2),'-',1) AS tel2,
SUBSTRING_INDEX('010-1234-5678','-',-1) AS tel3;
-- → 010 / 1234 / 5678
관련 링크: https://pafy.tistory.com/25
./comments