구분자를 통한 문자열 분해.
ex) ip 분해 ex)ip=192.168.0.1

select replace(substring(substring_index(ip, '.', 1), length(substring_index(ip, '.', 1 - 1)) + 1), '.', '') from test;
==> 192
select replace(substring(substring_index(ip, '.', 2), length(substring_index(ip, '.', 2 - 1)) + 1), '.', '') from test;
==> 168
select replace(substring(substring_index(ip, '.', 3), length(substring_index(ip, '.', 3 - 1)) + 1), '.', '') from test;
==> 0
select replace(substring(substring_index(ip, '.', 4), length(substring_index(ip, '.', 4 - 1)) + 1), '.', '') from test;
==>1

왜 함수를 안만들어놔가지고 이런 뻘짓하게 만드는거지???

'공부' 카테고리의 다른 글

엑셀(?) 중복내용 제거  (0) 2019.11.20
Vlookup 빠르게 하기  (0) 2019.11.20
mySQL 문자열 분해  (0) 2015.05.18
아웃룩 2013 ost 파일 위치 변경  (0) 2015.03.04
스팸의 원흉 – 활발히 활동하는 10대 봇넷  (0) 2011.12.14

+ Recent posts