HOUR
Jump to navigation
Jump to search
HOUR(d) | ||
---|---|---|
Engine | OK | Alternative |
ingres | No | EXTRACT(HOUR from d) |
mysql | Yes | EXTRACT(HOUR from d) |
oracle | No | TO_CHAR(d,'HH24') |
postgres | No | EXTRACT(HOUR from d) |
sqlserver | Yes | DATEPART(HOUR,d) |
HOUR
HOUR allows you to retrieve the hour from a datetime.
HOUR(d)
In this example you get the hour from the datetime field whn.
SELECT EXTRACT(HOUR from whn) AS v
,whn
,wht
FROM eclipse
SELECT EXTRACT(HOUR from whn) AS v
,whn
,wht
FROM eclipse
SELECT TO_CHAR(whn,'HOUR') AS v
,whn
,wht
FROM gisq.eclipse
SELECT HOUR(whn) AS v, whn, wht
FROM eclipse
See also
Language: | English • Deutsch |
---|