Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA38918 for ; Tue, 18 Jan 2000 14:06:18 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id OAA13219; Tue, 18 Jan 2000 14:06:04 -0500 (EST) From: Bruce Momjian Message-Id: <200001181906.OAA13219@candle.pha.pa.us> Subject: Re: [SQL] Ordering a date_part() query ... In-Reply-To: <3884B5BA.C1155D45@epamail.epa.gov> from Mark Volpe at "Jan 18, 2000 01:49:30 pm" To: Mark Volpe Date: Tue, 18 Jan 2000 14:06:04 -0500 (EST) CC: The Hermit Hacker , pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL66 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > INSERT INTO my_brain VALUES ('clue') :-) > > Whoops, Bruce's response reminded me, > what I meant to say was > ORDER BY "Summary - by Day/Hour"::datetime Yea, I was right. He is constructing a string here. > > Mark > > The Hermit Hacker wrote: > > > > I have a query that looks like: > > > > SELECT ( date_part('month', stat_period) || '/' || > > date_part('day', stat_period) || '/' || > > date_part('year', stat_period) || ' ' || > > date_part('hour', stat_period) || ':00:00' ) as "Summary - by > > Day/Hour", > > sum(impressions) as impressions, sum(click_thru) as click_thru > > FROM banner_count > > GROUP BY "Summary - by Day/Hour"; > > > > ************ > > -- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026