반응형
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | /* Number function */ /* dual : 오라클에서 제공되는 dummy table, 테이블이 없을 때 사용 all distinct : 중복제거 */ /* abs() : 절대값 */ select abs(-23) from dual; /* sign() */ select sign(23), sign(-23), sign(0) from dual; /* round(n1,n2) : 반올림 */ select round(0.123), round(0.543), round(0.125) from dual; select round(0.123456789,6), round(0.543465,2), round(0.125254,4) from dual; /* trunc(n1,n2) : 소수점 자르기 */ select trunc(1234.1234567) zero from dual; select trunc(1234.1234567,0) from dual; select trunc(1234.1234567,2) from dual; select trunc(1234.1234567,-1) from dual; /* ceil() : 올림 */ select ceil(32.8) ceil from dual; select ceil(32.3) ceil from dual; /* floor() : 내림 */ select floor(32.8) floor from dual; select floor(32.3) floor from dual; /* power(n1,n2) : 제곱 */ select power(4,2) power from dual; /* mod(n1,n2) : 나머지 */ select mod(7,4) mod from dual; /* sqrt() : 제곱근 */ select sqrt(2), sqrt(3) from dual; | cs |
반응형
'프로그래밍 > SQL' 카테고리의 다른 글
[Oracle SQL] GROUP BY, HAVING, ROLLUP (0) | 2017.08.08 |
---|---|
[Oracle SQL] 날짜함수 (0) | 2017.08.06 |
[Oracle SQL] 문자 함수 (0) | 2017.08.03 |
[Oracle SQL] Select 문 And,OR, NOT, BETWEEN (0) | 2017.07.29 |
[Oracle SQL] 토드 설치 (0) | 2017.07.29 |