Re: Setting week starting day

Поиск
Список
Период
Сортировка
От Jorge Godoy
Тема Re: Setting week starting day
Дата
Msg-id 87bqj2at7f.fsf@gmail.com
обсуждение исходный текст
Ответ на Re: Setting week starting day  ("Ted Byers" <r.ted.byers@rogers.com>)
Список pgsql-general
"Ted Byers" <r.ted.byers@rogers.com> writes:

> I  don't buy the suggestion that server side code is less error prone that
> client side code, but be that as it may, we're talking about a function that
> has one line of code.  And given what you just said, you don't want the day of
> the week, you want a function that returns the week of the year.  This can be
> had from the same Perl functions I mentioned before, with a minor alteration
> in how you call it.  my suggestion would be to create that one line function
> that invokes the relevant Perl function, which can then be invoked in your
> select statement (presumably with a group clause to avoid mixing data from
> different years).  It should take about ten to fifteen minutes to write and
> test?


There's no need to use Perl.

neo=# select extract('week' from now());
 date_part
-----------
        10
(1 registro)

neo=#


Today is a day at the tenth week of the year.




--
Jorge Godoy      <jgodoy@gmail.com>

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

Предыдущее
От: Jorge Godoy
Дата:
Сообщение: Re: Setting week starting day
Следующее
От: "Damian C"
Дата:
Сообщение: Re: Beginner's Questions