728x90
๋ฐ˜์‘ํ˜•

2025/01/04 1

[DB][Oracle] FLOOR / TRUNC

Oracle์—์„œ๋„ FLOOR๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.FLOOR ํ•จ์ˆ˜๋Š” ๊ฐ’์„ ์†Œ์ˆ˜์  ์ดํ•˜๋ฅผ ๋ฒ„๋ฆฌ๊ณ  ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ์ •์ˆ˜๋กœ ๋‚ด๋ฆฝ๋‹ˆ๋‹ค.๋”ฐ๋ผ์„œ ์†Œ์ˆ˜์  ์ดํ•˜๋ฅผ ๋ฒ„๋ฆฌ๋Š” ๋ชฉ์ ์œผ๋กœ๋Š” FLOOR์™€ TRUNC ๋ชจ๋‘ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.ํ•˜์ง€๋งŒ FLOOR๋Š” ํ•ญ์ƒ ๊ฐ’์„ ๋‚ด๋ฆฌ๋Š” ๋ฐฉ์‹์œผ๋กœ ๋™์ž‘ํ•˜๊ณ ,TRUNC๋Š” ์†Œ์ˆ˜์  ์ดํ•˜๋ฅผ ์ œ๊ฑฐํ•˜๋Š” ๊ฒƒ์ด ๋ชฉ์ ์ด๋ฏ€๋กœ,์†Œ์ˆ˜์  ์ดํ•˜๋ฅผ ๋‹จ์ˆœํžˆ ๋ฒ„๋ฆฌ๋Š” ์ž‘์—…์—๋Š” TRUNC๊ฐ€ ๋” ๋ช…ํ™•ํ•œ ์˜๋„๋ฅผ ์ „๋‹ฌํ•˜๋Š” ๋ฐ ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค. FLOOR vs TRUNC์˜ ์ฐจ์ด:ํ•จ์ˆ˜๋™์ž‘์˜ˆ (์ž…๋ ฅ๊ฐ’: -2.8, 2.8)๊ฒฐ๊ณผFLOOR๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ๋‚ฎ์€ ์ •์ˆ˜๋กœ ๋‚ด๋ฆผ-3, 2ํ•ญ์ƒ ์•„๋ž˜๋กœ ๋‚ด๋ฆผTRUNC์†Œ์ˆ˜์  ์ดํ•˜๋ฅผ ์ž˜๋ผ๋‚ด๊ณ  ์ •์ˆ˜ ๋ถ€๋ถ„๋งŒ ๋ฐ˜ํ™˜-2, 2๋ถ€ํ˜ธ์— ๊ด€๊ณ„์—†์ด ์†Œ์ˆ˜์  ์ œ๊ฑฐ

DB 2025.01.04
728x90
๋ฐ˜์‘ํ˜•