0.0 -> 0
1.0 -> 1
1.23 -> 1.23
이런식으로 소수점 뒤에 값이 있다면 그대로 출력
100.0 혹은 0.0이라면 100 이런식으로 출력 할 수 있게끔 할 수 있을까요?
도움 부탁드립니다.
with t as ( select 0.0 amt union all select 1.0 union all select 1.23 ) select amt , case when (amt % 1) = 0 then cast(cast(amt as decimal(10)) as varchar) else cast(amt as varchar) end amts from t