Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- IN
- sklearn
- string
- analizer
- Machine Learning
- 최댓값
- 최솟값
- count()
- numpy
- data
- 반복문
- function
- Python
- nan
- 덴드로그램
- DataFrame
- wcss
- insert()
- append()
- 분류 결과표
- pandas
- DataAccess
- list
- len()
- dendrogram
- del
- Dictionary
- hierarchical_clustering
- matplotlib
- elbow method
Archives
- Today
- Total
개발공부
[MySQL] 문자열 교체 replace(), 거꾸로 변경 reverse(), 길이 구하기 char_length(), 대소문자 변경 upper(), lower() 본문
Database/MySQL
[MySQL] 문자열 교체 replace(), 거꾸로 변경 reverse(), 길이 구하기 char_length(), 대소문자 변경 upper(), lower()
mscha 2022. 5. 16. 12:03books 테이블

1. 문자열 교체 함수 replace()
replace(원본, 교체하고 싶은 문자, 교체 후 문자)
title 컬럼에 들어있는 e를 3으로 바꿔서 가져오기.
select replace(title, 'e', '3')
from books;

2. 문자열의 순서를 거꾸로 바꾸는 함수 reverse()
'author_fname'을 뒤집어서 가져오기
select reverse(author_fname)
from books;

3. 문자열의 길이를 구하는 함수 char_length()
title의 길이를 구하기
select title, char_length(title) as length
from books;

4. 문자열의 대소문자 변경 함수 upper(), lower()
title 대문자로 변경
select UPPER(title)
from books;

title 소문자로 변경
select lower(TITLE)
from books;

'Database > MySQL' 카테고리의 다른 글
| [MySQL] 원하는 행 가져오기 limit, 문자열 검색 like (0) | 2022.05.16 |
|---|---|
| [MySQL] 데이터 중복 없이 선택 distinct, 데이터 정렬 order by (0) | 2022.05.16 |
| [MySQL] 문자열의 일부분만 가져오기 substr(), substring() (0) | 2022.05.16 |
| [MYSQL] 컬럼 합치기 concat(), concat_ws() (0) | 2022.05.16 |
| 데이터 조작어 DML (INSERT, UPDATE, DELETE, SELECT) (0) | 2022.05.16 |