Re: search for partial dates

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: search for partial dates
Дата
Msg-id 18768.1244752520@sss.pgh.pa.us
обсуждение исходный текст
Ответ на search for partial dates  ("James B. Byrne" <byrnejb@harte-lyne.ca>)
Ответы Re: search for partial dates  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
"James B. Byrne" <byrnejb@harte-lyne.ca> writes:
> Given a datetime column, not null, is there a single syntax that
> permits searching for all dates in a given year, year+month, and
> year+month+day such that a single parameterised query can handle all
> three circumstances?

Try date_trunc() ... however, if you want the query to be indexable,
it'll take a bit more work.

            regards, tom lane

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

Предыдущее
От: Christophe
Дата:
Сообщение: Re: search for partial dates
Следующее
От: Brandon Metcalf
Дата:
Сообщение: Re: listing relations