|
Re: [GENERAL] Grouping Question: msg#01409pgsql-general
You would use some of postgresql built in date functions to extract the week from the date and group by that i.e. select carrier, extract(week from start_time) as week, sum(call_length) as totallength, sum(cost) as total_cost from mytable group by carrier, extract(week from start_time) order by week, carrier you'll probably want to extract the year as well so dates weeks from alternate years don't get merged together Ketema Harris wrote: I have a table defined as -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
|
|
||||||||||||||||||||||||||
|
|
|
| News | Mail Home | sitemap | FAQ | advertise |