Skip site navigation (1) Skip section navigation (2)

group by date_part

From: M(dot)Mazurek(at)poznan(dot)multinet(dot)pl
To: pgsql-sql(at)postgresql(dot)org
Subject: group by date_part
Date: 2000-02-20 23:33:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
I have a table with some statistics and datetime field (data). I want
select counted records by day of the week.

select count (*) from stats group by date_part('dow',data::datetime_;

I get everthing sortded just as I wanted to, but how can I ad another
column to know which dow it is?
0  |123
4  | 322



pgsql-sql by date

Next:From: jdb371Date: 2000-02-21 00:39:47
Subject: it wont let me delete
Previous:From: Joe ConwayDate: 2000-02-20 19:55:18
Subject: pltcl and LDAP

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group