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

Re: [SQL] Ordering a date_part() query ...

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Mark Volpe <volpe(dot)mark(at)epamail(dot)epa(dot)gov>
Cc: The Hermit Hacker <scrappy(at)hub(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Ordering a date_part() query ...
Date: 2000-01-18 19:06:04
Message-ID: 200001181906.OAA13219@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-sql
> 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(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-sql by date

Next:From: The Hermit HackerDate: 2000-01-18 19:16:29
Subject: Re: [SQL] Ordering a date_part() query ...
Previous:From: Mark VolpeDate: 2000-01-18 18:49:30
Subject: Re: [SQL] Ordering a date_part() query ...

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