Difference between revisions of "MONTH"

From SQLZOO
Jump to: navigation, search
Line 45: Line 45:
 
   <li>[[SECOND |SECOND function]]</li>
 
   <li>[[SECOND |SECOND function]]</li>
 
</ul>
 
</ul>
 +
 +
{{Languages}}

Revision as of 22:18, 21 October 2012

Compatibility
MONTH(d)
EngineOKAlternative
ingresYesEXTRACT(HOUR from d)
mysqlYesEXTRACT(HOUR from d)
oracleNoTO_CHAR(d,'HH24')
postgresNoEXTRACT(HOUR from d)
sqlserverYesDATEPART(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(MONTH FROM whn) AS v
      ,whn
      ,wht
  FROM eclipse
SELECT TO_CHAR(whn,'MONTH') AS v
      ,whn
      ,wht
  FROM gisq.eclipse
SELECT MONTH(whn) AS v, whn, wht
  FROM eclipse

See also

Language: English  • Deutsch
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense