Microsoft SQL Server의 모듈러스 함수는 특정 데이터 형식에서만 작동합니다.TSQL에서 float의 모듈러스를 계산하는 방법은 무엇입니까?
은 MSDN 기사에 따르면 [1] 계수 연산자, 당신은 일반적으로 배당이 부동 소수점 데이터 유형 인 경우 작동하지 않습니다 ... 그러나이 같은
dividend % divisor
dividend
Is the numeric expression to divide. dividend must be a valid
expression of any one of the data types in the integer and
monetary data type categories, or the numeric data type.
divisor
Is the numeric expression by which to divide the dividend.
divisor must be any valid expression of any one of the data
types in the integer and monetary data type categories, or
the numeric data type.
를 계수를 사용합니다. 우리가 생각해 낸 대답은 나중에 참조 할 수 있도록 아래에 나열되어 있습니다.
[1] http://msdn.microsoft.com/en-us/library/ms190279.aspx
. 정확하지 않은 데이터 유형이므로 반올림 문제가 발생할 수 있습니다. – HLGEM
좋은 지적. 나는 오류 메시지가 지난 문제에 대해 생각하지 않았다. 그 지혜의 작은 조각을 가져 주셔서 감사합니다. –