Followup to week truncation thread

Поиск
Список
Период
Сортировка
От Mike Nolan
Тема Followup to week truncation thread
Дата
Msg-id 200509110555.j8B5tR4i017950@gw.tssi.com
обсуждение исходный текст
Список pgsql-general
A few days ago there was a thread dealing with how  a 'week' breaks.

I just had a need to run a transaction total by week and I wanted
a Sunday-Saturday week, not a Monday-Sunday week which is what the
date_trunc function gives.

Here was my solution:

select (date_trunc('week',mtrantime + interval '1 day')
- interval '1 day')::date as week,
count(*) as tot from trantable group by 1 order by 1;
--
Mike Nolan

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Tricky SELECT question involving subqueries
Следующее
От: Matthew Peter
Дата:
Сообщение: Re: back references using regex