[MySQL] INSTR()
MySQL 문자열 함수와 연산자
INSTR()
-
INSTR(str, substr)
의 형태
Returns the position of the first occurence of sustring substr in string str. This is the same as the two-argument form of LOCATE(), except that the order of the arguments is reversed.
This function is multibyte safe, and is case-sensitive only if at least one argument is a binary string.
mysql> SELECT INSTR('foobarbar', 'bar') ;
+---------------------------+
| INSTR('foobarbar', 'bar') |
+---------------------------+
| 4 |
+---------------------------+
1 row in set (0.00 sec)
mysql> SELECT INSTR('xbar', 'foobar') ;
+-------------------------+
| INSTR('xbar', 'foobar') |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)
mysql> SELECT INSTR('한글', '한') ;
+------------------------+
| INSTR('한글', '한') |
+------------------------+
| 1 |
+------------------------+
1 row in set (0.00 sec)