ORA
Sintassi
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> HOUR[HOUR]:::quoted
HOUR --> End((END))
Scopo
La funzione SQL HOUR estrae l'ora da una data e un'ora.
Vedi anche DAY, MICROSECOND, MILLISECOND, MINUTE, MONTH, SECOND e YEAR.
Parametri:
- Dati di input (
datetime): la data e l'ora da cui estrarre le ore.
Restituisce: l'ora sotto forma di int32.
Esempi
L'esempio seguente estrae le ore dalla data e dall'ora correnti del sistema in UTC:
select hour(sysdateutc)
-------------------
13
L'esempio seguente estrae le ore a partire da mezzogiorno del 1 gennaio, 2026:
select hour(to_date('20260101120000', 'YYYYMMDDHH24MISS'))
-------------------
12