SIGN
구문
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> SIGN[SIGN]:::quoted
SIGN --> End((END))
목적
SIGN SQL 함수는 숫자의 부호를 반환하며, -1은(는) 음수, 1은(는) 양수, 0은(는) 0을 나타냅니다.
ABS도 참조하십시오.
매개변수:
- 입력(
decimal): 숫자.
반환: int32로 표시된 부호.
예시
다음 예제는 음수, 0, 양수의 부호를 조회합니다:
select sign(-0.65565) negative
, sign(0) neutral
, sign(+20) positive
-------- -------- --------
-1 0 1
다음 예제는 입력이 null이므로 null을 반환합니다:
select sign(null)
--------