Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

435
Vistas
Extract year from postgres date

If I do the example of documenting works:

SELECT EXTRACT(YEAR FROM TIMESTAMP '2001-02-16 20:38:40');

But integrating it in my query gives an error, it will be very basic, but I do not know what it is.

select
responsable, 
fecha_contratado,
EXTRACT(YEAR FROM TIMESTAMP fecha_contratado) as alta
from rrhh.empleado
where responsable is not null

Thank you very much for the help Postgres 9.3

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You don't need TIMESTAMP keyword in this case, try this:

select
responsable, 
fecha_contratado,
EXTRACT(YEAR FROM fecha_contratado) as alta
from rrhh.empleado
where responsable is not null
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda