---
title: "SIGN"
description: "SIGN SQL-funktionen returnerer fortegnet for et tal, hvor -1 angiver et negativt tal, 1 et positivt tal og 0 nul."
language: da
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/da/docs/invantive-universalsql/grammar/sql-functions/sign
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/sign
updated: 2026-12-04T14:25:35Z
license: https://documentation.invantive.eu/da/
---

## Syntaks
```mermaid
%%{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))
```

## Formål
`SIGN` SQL-funktionen returnerer fortegnet for et tal, hvor -1 angiver et negativt tal, 1 et positivt tal og 0 nul.

Se også [[ABS]].

Parametre:
- Input (`decimal`): Et tal.

Returnerer: fortegnet som et `int32`.

## Eksempler
Følgende eksempel henter fortegnet for et negativt tal, nul og et positivt tal:
```sql
select sign(-0.65565) negative
,      sign(0) neutral
,      sign(+20) positive

-------- -------- --------
-1       0        1
```
Følgende eksempel returnerer `null`, da input er `null`:
```sql
select sign(null)

--------

```

