Re: [SQL] group by function, make SQL cleaner?

2006-03-15 Thread Tom Lane
Bryce Nesbitt <[EMAIL PROTECTED]> writes: > SELECT date_trunc('day',endtime),count(*) > FROM eg_event where endtime >= '2006-02-01' and endtime < '2006-03-01' > GROUP BY date_trunc('day',endtime) > ORDER BY date_trunc('day',endtime); > Is there a way to eliminate the ugly repeated use of > date_t

[SQL] group by function, make SQL cleaner?

2006-03-15 Thread Bryce Nesbitt
I've got a working query: stage=# SELECT date_trunc('day',endtime),count(*) FROM eg_event where endtime >= '2006-02-01' and endtime < '2006-03-01' GROUP BY date_trunc('day',endtime) ORDER BY date_trunc('day',endtime); date_trunc | count -+--- 2006-02-01 00:00:0

Re: [SQL] Copying a row within table

2006-03-15 Thread Aarni Ruuhimäki
On Wednesday 15 March 2006 03:11, John DeSoi wrote: > On Mar 14, 2006, at 2:19 AM, Aarni Ruuhimäki wrote: > > testing=# INSERT INTO foo (foo_1, foo_2, foo_3 ...) (SELECT foo_1, > > foo_2, > > foo_3 ... FROM message_table WHERE foo_id = 10); > > INSERT 717286 1 > > testing=# > > > > Is there a fast