SECOND

From SQLZOO
Jump to navigation Jump to search
Compatibility
SECOND(d)
EngineOKAlternative
ingresYesEXTRACT(SECOND from d)
mysqlYesEXTRACT(SECOND from d)
oracleNoTO_CHAR(d,'SS')
postgresNoEXTRACT(SECOND from d)
sqlserverYesDATEPART(SECOND,d)

SECOND

SECOND allows you to retrieve the second from a date.

   SECOND(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

Language:Project:Language policy English  • Deutsch
DataWars, Data Science Practice Projects - LogoDataWars: Practice Data Science/Analysis with +100 Real Life Projects