일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- HTML
- 개발자
- javascript
- Animation
- 애니메이션
- html5
- 프론트엔드
- react
- hover
- keyframes
- ipad
- jQuery
- 비전공 개발자
- iOS 개발자
- button
- SWIFT
- 백엔드
- effect
- php
- CSS
- image
- 비전공자
- css3
- xcode
- 자바스크립트
- IOS
- front-end
- MAC
- iPhone
- 풀스택
- Today
- Total
비전공자 개발일기
FIND_IN_SET() 본문
FIND_IN_SET() in MySQL
- Syntax: FIND_IN_SET(search string, string list)
- Example: FIND_IN_SET('ank', 'b,ank,of,monk')
$datas = "";
foreach ($data_info as $key => $value) {
$datas .= $value . ",";
}
- Example2:
SELECT * FROM client_contract WHERE FIND_IN_SET(idx,'{$datas}')-> client_contract 테이블에서 {$datas}라는 필드값에서 idx인 데이터만을 반환
- Result: 2
-> 특정 세트(ex 배열) 내에 있는 걸 찾는다는 의미로, 해당 string의 위치를 반환
-> 검색한 문자의 값이 없을 경우, 0을 반환
https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_find-in-set
MySQL :: MySQL 5.7 Reference Manual :: 12.8 String Functions and Operators
12.8 String Functions and Operators Table 12.12 String Functions and Operators Name Description ASCII() Return numeric value of left-most character BIN() Return a string containing binary representation of a number BIT_LENGTH() Return length of argument
dev.mysql.com
https://www.w3resource.com/mysql/string-functions/mysql-find_in_set-function.php
MySQL FIND_IN_SET() function - w3resource
MySQL FIND_IN_SET() returns the position of a string if it is present (as a substring) within a list of strings.
www.w3resource.com