Re: Extract week from date
От | Filip Rembiałkowski |
---|---|
Тема | Re: Extract week from date |
Дата | |
Msg-id | 92869e660905180754u282e877ak22052a6188e4e037@mail.gmail.com обсуждение исходный текст |
Ответ на | Extract week from date (Dani Castaños <dcastanos@androme.es>) |
Ответы |
Re: Extract week from date
|
Список | pgsql-sql |
2009/5/18 Dani Castaños <dcastanos@androme.es>
hmmm.. it's not clear what do you want.
why not just something like
SELECT EXTRACT( week from statistics_date ) as week, SUM(
total_duration) as total_duration_sum
FROM statistics_daily GROUP BY 1;
Hi again,
I need to extract date grouped by week from an statistics table.
I was trying something like this:
SELECT total_duration, EXTRACT( week from date statistics_date )
FROM statistics_daily
GROUP BY EXTRACT( week from date statistics_date ), total_duration;
But it doesn't works... Neither:
SELECT total_duration, statistics_date
FROM statistics_daily
GROUP BY EXTRACT( day from statistics_date ), total_duration,
statistics_date;
hmmm.. it's not clear what do you want.
why not just something like
SELECT EXTRACT( week from statistics_date ) as week, SUM(
total_duration) as total_duration_sum
FROM statistics_daily GROUP BY 1;
?
--
Filip Rembiałkowski
JID,mailto:filip.rembialkowski@gmail.com
http://filip.rembialkowski.net/
В списке pgsql-sql по дате отправления: