Re: Setting week starting day

Поиск
Список
Период
Сортировка
От Ted Byers
Тема Re: Setting week starting day
Дата
Msg-id 0be001c7629f$85135fb0$6401a8c0@RnDworkstation
обсуждение исходный текст
Ответ на Tabulate data incrementally  (Omar Eljumaily <omar2@omnicode.com>)
Ответы Re: Setting week starting day
Список pgsql-general
----- Original Message -----
From: "Omar Eljumaily" <omar2@omnicode.com>
To: "Ted Byers" <r.ted.byers@rogers.com>
Cc: <pgsql-general@postgresql.org>
Sent: Friday, March 09, 2007 5:00 PM
Subject: Re: [GENERAL] Setting week starting day


> Ted, my reason for asking the question that I believe precipitated this
> thread was that I wanted a single sql statement that aggregated time data
> by week.  Yes, I could do the aggregation subsequently in my own client
> side code, but it's easier and less error prone to have it done by the
> server.
>
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?

Ted



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Weird behaviour on a join with multiple keys
Следующее
От: Jorge Godoy
Дата:
Сообщение: Re: Setting week starting day