SECOND

From SQLZOO
Revision as of 13:53, 16 July 2012 by Connor (Talk | contribs) (Created page with "<table align='right' border='1'> <caption>Compatibility</caption> <tr><th colspan='3'>SECOND(d)</th></tr> <tr><td align='center'>'''Engine'''</td><td align='center'>'''OK'''</...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Compatibility
SECOND(d)
EngineOKAlternative
ingresYesEXTRACT(HOUR from d)
mysqlYesEXTRACT(HOUR from d)
oracleNoTO_CHAR(d,'HH24')
postgresNoEXTRACT(HOUR from d)
sqlserverYesDATEPART(HOUR,d)

SECOND

SECOND allows you to retrieve the second from a date.

   HOUR(d)

In this example you get the second from the date field whn.

SELECT EXTRACT(SECOND FROM whn) AS v
      ,whn
      ,wht
  FROM eclipse
SELECT TO_CHAR(whn,'SECOND') AS v
      ,whn
      ,wht
  FROM gisq.eclipse
SELECT SECOND(whn) AS v, whn, wht
  FROM eclipse

See also