YEAR/de

From SQLZOO
< YEAR
Revision as of 21:41, 21 October 2012 by Peter (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, 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

Sprache: English  • Deutsch
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense