Extract week from date - Mailing list pgsql-sql

From Dani Castaños
Subject Extract week from date
Date
Msg-id 007d01c9d7c6$af6aac70$0e400550$@es
Whole thread Raw
Responses Re: Extract week from date
List pgsql-sql
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;


How can it be done?


Note: statistics_date is a DATE data type column.

Regards.

--
Dani Castaños Sánchez
dcastanos@androme.es




pgsql-sql by date:

Previous
From: Pawel Socha
Date:
Subject: Re: SUM Array values query
Next
From: Filip Rembiałkowski
Date:
Subject: Re: Extract week from date