Re: Setting week starting day (was: Re: Tabulate data incrementally)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Setting week starting day (was: Re: Tabulate data incrementally)
Дата
Msg-id 20070308221047.GE4715@alvh.no-ip.org
обсуждение исходный текст
Ответ на Setting week starting day (was: Re: Tabulate data incrementally)  (Jorge Godoy <jgodoy@gmail.com>)
Ответы Re: Setting week starting day  (Jorge Godoy <jgodoy@gmail.com>)
Список pgsql-general
Jorge Godoy escribió:

> I mean, if I wanted to do the above but instead of Sunday or Monday as the
> starting day I'd like using Fridays or Wednesdays...
>
> Is it possible?  Writing a new function shouldn't be too hard -- it's a matter
> of truncating the week on a day and shifting the date forward or backward --,
> but something like a "SET bow=5" (to make the API consistent with the 'dow'
> that already exists) would be really great!

Is it not just a matter of adding a constant and then taking modulo 7?

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: "oracle to postgresql" conversion
Следующее
От: Shane Ambler
Дата:
Сообщение: Re: security permissions for functions