Re: query by partial timestamp

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: query by partial timestamp
Дата
Msg-id 50ECA03E.1040700@iol.ie
обсуждение исходный текст
Ответ на Re: query by partial timestamp  (Raymond O'Donnell <rod@iol.ie>)
Ответы Re: query by partial timestamp  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-general
On 08/01/2013 22:26, Raymond O'Donnell wrote:
> 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.

Sorry, meant to include the reference:

http://www.postgresql.org/docs/9.2/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT

Ray.

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


В списке pgsql-general по дате отправления:

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: query by partial timestamp
Следующее
От: Rob Sargent
Дата:
Сообщение: Re: query by partial timestamp