Re: query by partial timestamp - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: query by partial timestamp
Date
Msg-id 50EC9D1F.5070406@iol.ie
Whole thread Raw
In response to query by partial timestamp  (Kirk Wythers <kwythers@umn.edu>)
Responses Re: query by partial timestamp
Re: query by partial timestamp
List pgsql-general
On 08/01/2013 22:19, Kirk Wythers wrote:
> I have a column of type TIMESTAMP, I'd like to query all records from
> 2011. If it were text I could use a partial such as:
>
> WHERE text ~ '2011'
>
> There must be a simple way to pull the year part out of a timestamp
> format. Thanks in advance.

You want the extract() function.

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie


pgsql-general by date:

Previous
From: Kirk Wythers
Date:
Subject: query by partial timestamp
Next
From: Raymond O'Donnell
Date:
Subject: Re: query by partial timestamp