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: Pine.BSF.4.21.0002202332360.72356-100000@arka.poznan.mtl.pl (view raw or flat)
Thread:
Lists: pgsql-sql
HI,
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?
eg:
dow|count
---------
0  |123
4  | 322
...

mazek



Responses

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-2014 The PostgreSQL Global Development Group