From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Vincent Hikida <vhikida(at)inreach(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Fw: Is SQL silly as an RDBMS<->app interface? |
Date: | 2003-07-25 01:22:14 |
Message-ID: | 200307250122.h6P1MEq22894@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
You could do something like:
retrieve (a.dept, x=sum(a.total by a.dept) / sum(a.total));
if I remember correctly.
---------------------------------------------------------------------------
Vincent Hikida wrote:
>
> ----- Original Message -----
> From: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
> To: "elein" <elein(at)varlena(dot)com>
> Cc: "Jan Wieck" <JanWieck(at)Yahoo(dot)com>; "Vincent Hikida"
> <vhikida(at)inreach(dot)com>; <pgsql-general(at)postgresql(dot)org>
> Sent: Thursday, July 24, 2003 5:35 PM
> Subject: Re: Fw: [GENERAL] Is SQL silly as an RDBMS<->app interface?
>
>
> >
> > Yes, it was more powerful because you could do aggregates in the query
> > independent of the results returned by the query.
> >
> > The 'by' feature of aggregates always confused me because it would
> > modify the aggregate WHERE clause (that was independent of the outer
> > query) and restrict the aggregate to only process rows where the outer
> > query's column value matched the same column's value in the aggregate.
> >
>
> Actually, I used a hierarchical/relational DBMS called Nomad in 1981. If I
> understand Bruce, Nomad could do the same thing. I could aggregate at
> different levels in the same query. Each aggregate created a break and I
> could add whatever code I wanted at the level. I could also refer to any
> level of aggregate in the rest of the query. I could also refer to any level
> aggregate in the rest of the code. This meant that I could for example
> calculate what percentage of the total the individual row was. The only
> problem was that I could only join two tables at a time so if I wanted to
> join several tables I had to have several statements. Each statement created
> an intermediate table which was easy to refer to in subsequent statements.
>
> Vincent
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2003-07-25 01:26:39 | Re: Can I turn the case sensitive off |
Previous Message | Vincent Hikida | 2003-07-25 01:10:32 | Re: Fw: Is SQL silly as an RDBMS<->app interface? |