YEAR/de

From SQLZOO
Jump to navigation Jump to search
Kompatibilität
YEAR(d)
DBMSOKAlternative
IngresJa EXTRACT(YEAR from d)
MySQLJa EXTRACT(YEAR from d)
OracleNein TO_CHAR(d,'YYYY')
PostgreSQLNein EXTRACT(YEAR from d)
SQL ServerJa DATEPART(YEAR,d)

YEAR

YEAR ermittelt das Jahr aus einem Datumswert.

   YEAR(d)

In diesem Beispiel wird das Jahr aus dem whn-Datum ermittelt.

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

Siehe auch

Language:Project:Language policy [[:{{#invoke:String|sub|YEAR/de
 |1
 |Expression error: Unrecognized punctuation character "{".
}}|English]]
DataWars, Data Science Practice Projects - LogoDataWars: Practice Data Science/Analysis with +100 Real Life Projects