ORACLE μ«μν¨μ κΈ°λ³Έ μ¬μ©
ABS ν¨μ
QUERY
1 | SELECT ABS(-500), ABS(500) FROM DUAL; | cs |
RESULT
SIGN ν¨μ
QUERY
1 | SELECT SIGN(-500), SIGN(500), SIGN(0) FROM DUAL; | cs |
RESULT
POWER ν¨μ
μ κ³±κ°μ ꡬν΄μ£Όλ ν¨μμ΄λ€.
QUERY
1 | SELECT POWER(2,10) FROM DUAL; | cs |
RESULT
MOD ν¨μ
λλ ν λλ¨Έμ§ κ°μ ꡬν΄μ£Όλ ν¨μμ΄λ€.
QUERY
1 | SELECT MOD(9,2), MOD(8,3) FROM DUAL; | cs |
RESULT
SQRT ν¨μ
μ κ³±κ·Όμ ꡬν΄μ£Όλ ν¨μμ΄λ€.
QUERY
1 | SELECT SQRT(16), SQRT(15) FROM DUAL; | cs |
RESULT
CEIL ν¨μ
μ μ κΈ°μ€μΌλ‘ μ¬λ¦Όμ ν΄μ£Όλ ν¨μμ΄λ€. μμμ μ리μλ₯Ό μ ννμ§ μκ³ μ μκΈ°μ€μΌλ‘ μ¬λ¦Όμ μ²λ¦¬νλ€.
μ¦, μμμ νν΄μ μ¬μ©μ΄κ°λ₯νλ€.
QUERY
1 | SELECT CEIL(123.456), CEIL(123.567) FROM DUAL; | cs |
RESULT
FLOOR
QUERY
1 | SELECT FLOOR(123.456), FLOOR(123.567) FROM DUAL; | cs |
RESULT
ROUND ν¨μ
λ°μ¬λ¦Όμ ν΄μ£Όλ ν¨μμ΄λ€. nλ²μ§Έ μ리κΉμ§ κ²°κ³Όκ° λμ€λλ‘ λ°μ¬λ¦Όμ νλ€.
nλ²μ§Έ μ리μλ μμλ₯Ό μ¬μ©νκ²λλ©΄ μΌμ리 : 0, 10μ리 : -1, 100μ리 : -2 μμ λ°μ¬λ¦Όμ νλ€. μλ΅νλ€λ©΄ 0μΌλ‘ κ°μ£Όνκ³ λ°μ¬λ¦Όμ νλ€.
QUERY
1 | SELECT ROUND(0.515), ROUND(0.156,1), ROUND(0.152,2) FROM DUAL; | cs |
RESULT
TRUNC ν¨μ
λ°μ¬λ¦Όμ΄λμ μ‘°κΈ λ€λ₯΄κ² nλ²μ§Έ μ리κΉμ§λ§ μΆλ ₯νκ³ λλ¨Έμ§λ μλΌ λ²λ¦°λ€. μμμ μλκ° μλλ©΄ nλ²μ§Έ μ리κΉμ§λ 0μΌλ‘ νμλλ€.
ROUNDμ λ§μ°¬μκΈ°λ‘ nλ²μ§Έ μ리κΉμ§ μμλ μ¬μ©κ°λ₯νλ€.
QUERY
1 2 3 4 5 6 | SELECT TRUNC(1234.56789,-1) AS "-1μ리" ,TRUNC(1234.56789) AS "0μ리" ,TRUNC(1234.56789, 1) AS "1μ리" ,TRUNC(1234.56789, 2) AS "2μ리" FROM DUAL; | cs |
λκΈ