-- concat (문자열, 문자열 ...) 문자열 합연산 함수
select concat("abc" , "def","ghi") as " 문자열 합연산 함수" ;
-- 문자열 기준 오른쪽 공백 제거
select rtrim('abc ') ;
select ltrim(' abc');
-- 문자열을 소문자로
select lower("ABC");
-- 문자열을 대문자로
select upper("abc");
-- 문자열을 역순으로
select reverse("abcde");
-- 해당하는 문자를 찾아서 변환해줌
select replace("abcde", "a" ,"가");
-- 2번째 글자 뒤부터 세글자만
select substring("abcde", 2,3);
-- 문자열의 길이값
select char_length("abcde");
-- 절대값
select abs(-32);
-- 반올림
select round(55.55,1);
-- 올림
select ceil(15.555);
-- 내림
select floor(15.555);
-- 2의 세제곱
select pow(2,3);
-- 0 ~ 1 난수 생성
select rand();
'MySQL' 카테고리의 다른 글
서브쿼리 정리하기 (0) | 2022.01.27 |
---|---|
sum , count , average (0) | 2022.01.27 |
패턴매칭 (Like / not like ) limit /offset 중복제거 (distinct ) (0) | 2022.01.27 |
column을 Primary Key 로 설정하고 키 값으로 삭제하기 (0) | 2022.01.26 |
데이터베이스 와 table 생성하고 row 추가하기 (0) | 2022.01.26 |