DB/MariaDB17 [MariaDB] 10.논리 함수 ifnull(column명,false) column이 null이면 false를 출력, null이 아니면 그대로 출력 if(boolean,true,false) boolean(0 = false, 그 외 = true)에 따라 true와 false 실행 case 문자열 when 비교값 then data else data 문자열과 비교값이 동일하면 data를 실행 java의 switch와 비슷 2022. 12. 20. [MariaDB] 9. 수학 함수 abs(숫자) 절대값 ceiling(숫자) 올림 floor(숫자) 내림 round(숫자) 소숫점 올림 round(숫자, 소숫점 자리 수) 소수점 자리 수까지 올림 truncate(숫자, 소숫점 자리 수) 소수점 자리 수까지 자름 pow(숫자, 승) mod(숫자,숫자) 나머지 구하기 pi() pi greatest(숫자,숫자, ... ) 가장 큰 숫자 return least(숫자,숫자, ... ) 가장 작은 숫자 return interval(첫 숫자,숫자, ... ) 첫 숫자가 뒤에 나오는 숫자들과 값 비교하여 위치를 return 처음으로 비교하는 숫자가 더 크면 return = 0 2022. 12. 20. [MariaDB] 8. 문자열 및 날짜 자르기 공백 포함해서 index를 센다. left (문자열, count) 1~count right (문자열, count) (end_index - count) ~ end_index mid (문자열, index) index~end_index mid (문자열, index, count) index ~ count substring(문자열, index) index~end_index substring (문자열, index, count) index ~ count 길이 length length(문자열) byte로 계산, 한글은 3byte char_length(문자열) 글자 수(공백 포함) 검색 instr(문자열, 문자) 글자 찾음, 대소문자 구분 X, 없으면 return = 0 posittion(문자 in 문자열) 글자.. 2022. 12. 20. [MariaDB] 7. 연산자 및 기본 함수 논리 연산자 = 같다 , != 같지 않다 >, =, 2022. 12. 20. [MariaDB] 6. data 추가, 삭제, 수정 data 추가 추가 insert into table명 values ( data, data, data, data); 일부 column에만 data 추가 insert into table명 (column명, column명) values (data, data); 여러 data추가 insert into table명 values (data,data),(data,data); data 확인 모두 확인 select * from table명; 특정 column 조회 select column명 from table명; 특정 data 조회 select column명 from table명 where column명 = data; data 수정 모든 data의 특정 column data값 수정 update table명 set col.. 2022. 12. 20. [MariaDB] 5. column 추가, 삭제, 변경 column 추가 column 단일 추가 alter table table명 add column명 자료형; 여러 column 추가 add ( column , column); alter table table명 add ( column명 자료형, column명 자료형, ); column 확인 방법 1 : DESCRIBE table명; 방법 2 : desc table명; column 추가 위치 첫번 째로 column 추가 first alter table table명 add column명 자료형 first ; 특정 column 뒤에 추가 after 특정 column alter table table명 add column명 자료형 after 특정column ; column 삭제 column 삭제 drop column명.. 2022. 12. 20. 이전 1 2 3 다음