charindex 특정 문자 찾기
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Declare @RELULAR varchar(100) Set @RELULAR = '[5]\s*BEFORE\s*DEPARTURE\s*OF\s*THE\s*ORIGINALLY\s*SCHEDULED\s*FLIGHT\s*CHARGE\s*[16]' Select CHARINDEX('[5]', @RELULAR) //1 Declare @VAR_IDX int Set @VAR_IDX = 16 Select CHARINDEX('[' + Convert(varchar(2),@VAR_IDX) + ']' ,@RELULAR) //86 |
참조 : https://gent.tistory.com/347#:~:text=%EC%A0%A0%ED%8A%B8%EC%9D%98%20%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D%20%EC%84%B8%EC%83%81&text=SQL%20Server%EC%97%90%EC%84%9C%20CHARINDEX(