Re: using dates in pgsql

Поиск
Список
Период
Сортировка
От Tyler Colbert
Тема Re: using dates in pgsql
Дата
Msg-id bj3gvp$2mk$1@sea.gmane.org
обсуждение исходный текст
Ответ на using dates in pgsql  (JohnH <JohnH@atkgib.com.au>)
Список pgsql-novice
"Ron Johnson" <ron.l.johnson@cox.net> wrote in message
news:1062080015.25751.319.camel@haggis...
> On Thu, 2003-08-28 at 08:41, Tom Lane wrote:
> > <shrug> ... that's what the "date - integer" operator is defined to do.
> > If you want some other behavior, create another operator.
>

I have used something like this:
    now() - interval '3 hours'

so I supposed you could do
    CURRENT_DATE - interval '188 days'

this would probably work more accurately (due to leap year)
    CURRENT_DATE - interval '6 months'

or if you want to take time into account
    now() - interval '6 months'

Tyler Colbert




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

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: Number of rows in a table
Следующее
От: Oliver Fromme
Дата:
Сообщение: Revoke access on pg_user