| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
- String Function and Operators
- Data and Time Functions
- MySQL
- Sring Functions and Operators
- SVN
- 윈도우
- Oracle
- 티베로
- 방화벽
- Tibero
- Date and Time Function
- 전자정부표준프레임워크
- Date and Time Functions
- 전자정부 표준프레임워크
- String Functions and Operators
- String Functions and Date Operators
- HTTP
- 오라클
- Today
- Total
웹이야기
[MySQL] LOCATE() 본문
MySQL 문자열 함수와 연산자
LOCATE()
-
LOCATE(substr, str)
LOCATE(substr, str, pos)
의 형태
The first syntax returns the position of the first occurence of substring substr in string str. The second syntax returns the position of the first occurence of substring substr in string str, starting at position pos. Returns 0 if substr is not in str. Returns NULL if any argument is NULL.
mysql> SELECT LOCATE('bar', 'foobarbar');
+----------------------------+
| LOCATE('bar', 'foobarbar') |
+----------------------------+
| 4 |
+----------------------------+
1 row in set (0.00 sec)
mysql> SELECT LOCATE('xba4', 'foobar') ;
+--------------------------+
| LOCATE('xba4', 'foobar') |
+--------------------------+
| 0 |
+--------------------------+
1 row in set (0.00 sec)
mysql> SELECT LOCATE('bar', 'foobarbar', 5) ;
+-------------------------------+
| LOCATE('bar', 'foobarbar', 5) |
+-------------------------------+
| 7 |
+-------------------------------+
1 row in set (0.00 sec)
'D > ORACLE' 카테고리의 다른 글
| [MySQL]TO_BASE64() (0) | 2020.06.11 |
|---|---|
| [MySQL]SUBSTRING() (0) | 2020.06.11 |
| 오라클 hr 계정 unlock , hr 계정 lock 풀기 (0) | 2020.03.22 |
| 오라클 연산자 (0) | 2020.03.22 |
| 오라클 집합 연산자 (0) | 2020.03.16 |