FIRMA
Sintaxis
%%{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))
Propósito
La función SQL SIGN devuelve el signo de un número, donde -1 representa un número negativo, 1 un número positivo y 0 el cero.
Véase también ABS.
Parámetros:
- Entrada (
decimal): Un número.
Resultados: el signo como int32.
Ejemplos
En el siguiente ejemplo se obtiene el signo de un número negativo, un cero y un número positivo:
select sign(-0.65565) negative
, sign(0) neutral
, sign(+20) positive
-------- -------- --------
-1 0 1
El siguiente ejemplo devuelve null, ya que la entrada es null:
select sign(null)
--------