Re: Ayuda sobre fechas

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Kelly González Enríquez <kge_7(at)yahoo(dot)com(dot)mx>
Cc: postgresql <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Ayuda sobre fechas
Date: 2006-02-21 00:40:46
Message-ID: c2d9e70e0602201640h274badaaj7f520cff38608f96@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On 2/20/06, Kelly González Enríquez <kge_7(at)yahoo(dot)com(dot)mx> wrote:
> Hola lista
>
> Tengo una duda sobre fechas y es la siguiente:
>
> Quiero hacer una consulta en donde sólo obtenga de un campo fecha el año
> de esta, es decir: mi campo se llama IaAfecha es de tipo date, existe alguna
> funcion en postgresql que lo pueda hacer? o como se haría?
>
> IaAfecha
> 2000-02-02
> 2000-02-03
>
> en la consulta obtener solo 2000
>
>

select extract(year from laAfecha) from tabla;

--
Atentamente,
Jaime Casanova

"What they (MySQL) lose in usability, they gain back in benchmarks, and that's
all that matters: getting the wrong answer really fast."
Randal L. Schwartz

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Roberto 2006-02-21 00:46:54 Restricciones por Usuario de postgres
Previous Message Jaime Casanova 2006-02-21 00:38:37 Re: - - Problema con ídices .