๋ฐ์ฌ๋ฆผ - ROUND()
SELECT ROUND(2.73) AS RESULT FROM DUAL;
RESULT |
3 |
์์์ ์๋ฅด๊ธฐ - TRUNCATE()
SELECT TRUNCATE(2.73, 0) AS RESULT FROM DUAL;
RESULT |
2 |
์์์ ํ์ - ROUND(number, decimals)
SELECT ROUND(2.73, 1) AS RESULT FROM DUAL;
RESULT |
2.7 |
๋ฉ๋ชจ
MySQL ROUND() Function
Syntax
ROUND(number, decimals)
Parameter Values
ParameterDescription
number | Required. The number to be rounded |
decimals | Optional. The number of decimal places to round number to. If omitted, it returns the integer (no decimals) |
MySQL TRUNCATE() Function
Syntax
TRUNCATE(number, decimals)
Parameter Values
ParameterDescription
number | Required. The number to be truncated |
decimals | Required. The number of decimal places to truncate to |
'๐ป Programming > SQL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[SQL] ์กฐ์ธ(join) - 01 (0) | 2024.03.02 |
---|---|
[DBeaver] DB Dump ๋ฐฑ์ ๋ฐ ๋ฐฑ์ ํ์ผ ๋ณต๊ตฌ ๋ฐฉ๋ฒ (0) | 2024.02.20 |
[DBeaver] DBeaver์ค์น + PostgreSQL ์ฐ๊ฒฐํ๊ธฐ (0) | 2024.02.13 |
[PostgreSQL] macOS m1 ํ๊ฒฝ์ PostgreSQL ์ค์น (0) | 2024.02.13 |