Difference between revisions of "MONTH"

From SQLZOO
Jump to: navigation, search
Line 13: Line 13:
 
<p></p>  
 
<p></p>  
 
<pre style='width:60ex'>
 
<pre style='width:60ex'>
   HOUR(d)
+
   MONTH(d)
 
</pre>
 
</pre>
  

Revision as of 21:23, 21 October 2012

Compatibility
MONTH(d)
EngineOKAlternative
ingresYesEXTRACT(MONTH from d)
mysqlYesEXTRACT(MONTH from d)
oracleNoTO_CHAR(d,'MM')
postgresNoEXTRACT(MONTH from d)
sqlserverYesDATEPART(MONTH,d)

MONTH

MONTH allows you to retrieve the hour from a date.

   MONTH(d)

In this example you get the month from the date 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