๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
DB/Oracle

[Oracle] ์˜ค๋ผํด ๋ฌธ์ž์—ด ํ•ฉ์น˜๊ธฐ ( ||, CONCAT)

by yunamom 2022. 2. 3.
๋ฐ˜์‘ํ˜•

SQL> SELECT 1||'+'||2 ํ…Œ์ŠคํŠธ FROM DUAL;

ํ…Œ์ŠคํŠธ
------
1+2

์‹ค๋ฌด์—์„œ๋Š” "||" ๋ฅผ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š” ํŽธ์ž…๋‹ˆ๋‹ค.


SQL> SELECT CONCAT('1','+'),CONCAT(CONCAT('1','+'),'2') FROM DUAL;

CONC CONCAT
---- ------
1+   1+2

CONCAT ์„ 3๋ฒˆ์ด์ƒ ์‚ฌ์šฉํ•˜๋ ค๋ฉด CONCAT ์•ˆ์— CONCAT ์„ ๋˜ ์ž‘์„ฑํ•ด์•ผํ•ด์„œ ๊ฐ€๋…์„ฑ์ด ๋งŽ์ด ๋–จ์–ด์ง‘๋‹ˆ๋‹ค.

300x250

์ฝ”๋“œ