(fu)mssql isnumeric 함수(숫자체크)

fullmi(49)
Published in
#it
Words
36
Reading
1 min
9y
Listen to this post
~1 min

업무를 하고 있는데


특정 상황에서


Sum값이 에러가 난다.


쩝


원인은 데이터중 숫자가 아닌 놈들이 있었다


일단 합산을 할때 


다음과 같이 숫자임을 체크하고 


아래와 같이 sum을 하였다 



select sum(case when isnumeric(total) = 1 then total else 0 end) as sum_total

from table

where condition


2018년 1월 24일 수요일