NUMBER(20, 8) 자리 데이터를 조회시
1.2345 -> 1.2345
.12345 -> 0.12345 => 소수자릿수가 정수부에 0일경우 0이 안보이게 조회되는데 0으로 조회되게 할수있는 방법이 없을까요?
음..원래 보이는데.. sql 환경설정때문인가?? 음.. 그래도 구지 보고 싶으시다면, to_char(n,format) 을 이용하세요.
개발하시는 스크립트(툴) 에 output에서 조정하셔야 할 듯 합니다
sqlplus에서는 아래와 같이 처리할겁니다.
set numformat "FM999,999,990.9999" col type1 format a15 col type2 format a15 col type3 format a15 with t as( select 21.112 n from dual union all select 1.12 from dual union all select 2.1222 from dual union all select 0.112 from dual union all select 123.12 from dual union all select 123456789.12 from dual union all select 1.2 from dual union all select .2 from dual union all select 1 from dual union all select null from dual union all select .112 from dual ) SELECT n , to_char(n, 'FM999999990.9999') type1 , CASE WHEN n < 1 THEN '0' ELSE '' END || n type2 , decode(sign(n-1), -1, '0' || n, n) type3 from t