Oracle 의 instr()함수 응용 및 사용 상세 설명
형식 1:instr(string 1,string 2)//instr(원본 문자열,대상 문자열)
형식 2:instr(string 1,string 2[,startposition [, nth_appearance])//instr(원본 문자열,대상 문자열,시작 위치,일치 번호)
해석:string 2 의 값 은 string 1 에서 찾 아야 합 니 다.startposition 에서 제 시 된 수치(즉:위치)는 string 1 에서 검색 하고 nth 를 검색 합 니 다.appearance(몇)회 string 2 가 나타 납 니 다.
주:Oracle/PLSQL 에서 인 스 터 함 수 는 원본 문자열 의 위 치 를 되 돌려 줍 니 다.한 번 만 검색 하면 문자 의 시작 부터 문자 의 끝 까지 끝 난 다 는 것 이다.
2.실례
서식 1
select instr('helloworld','l') from dual; -- :3 “l”
select instr('helloworld','lo') from dual; -- :4 “lo” ( ) ,“l”
select instr('helloworld','wo') from dual; -- :6 “w”
서식 2
select instr('helloworld','l',2,2) from dual; -- :4 : "helloworld" 2(e) , “l”
select instr('helloworld','l',3,2) from dual; -- :4 : "helloworld" 3(l) , “l”
select instr('helloworld','l',4,2) from dual; -- :9 : "helloworld" 4(l) , “l”
select instr('helloworld','l',-1,1) from dual; -- :9 : "helloworld" 1(d) , “l”
select instr('helloworld','l',-2,2) from dual; -- :4 : "helloworld" 2(l) , “l”
select instr('helloworld','l',2,3) from dual; -- :9 : "helloworld" 2(e) , “l”
select instr('helloworld','l',-2,3) from dual; -- :3 : "helloworld" 2(l) , “l”
주:MySQL 의 모호 한 조회 like 와 Oracle 의 intr()함수 가 같은 조회 효 과 를 가 집 니 다.다음 과 같다.
MySQL: select * from tableName where name like '%helloworld%';
Oracle:select * from tableName where instr(name,'helloworld')>0; --
3.인 스 턴 스 캡 처
1、
2、
3、
4、
5、
6、
7、
8、
9、
이상 이 바로 본 고의 모든 내용 입 니 다.여러분 의 학습 에 도움 이 되 고 저 희 를 많이 응원 해 주 셨 으 면 좋 겠 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Oracle 생성 향후 3일간의 전체 시점 (단계 상세)수요: X 좌표축 시간은 모두 정시 시간으로 앞으로 3일 동안의 예측을 보여준다(x 축은 앞으로 3일 동안의 정시 시간을 보여준다), 3시간마다 한 눈금, 가로 좌표는 모두 24개의 눈금을 보여준다 1단계: 현재 시...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.