From: | Raymond O'Donnell <rod(at)iol(dot)ie> |
---|---|
To: | Robert Buckley <robertdbuckley(at)yahoo(dot)com> |
Cc: | salah jubeh <s_jubeh(at)yahoo(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Create loop in postgresql |
Date: | 2012-09-03 16:16:42 |
Message-ID: | 5044D7EA.3070805@iol.ie |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 03/09/2012 17:06, Robert Buckley wrote:
> this give an error.
>
> select name,ges_kw_zgb, SELECT round(100 * (ges_kw_zgb / (select
> sum(ges_kw_zgb) From energie.tennet_auswertung_2010)),2);
>
> ERROR: syntax error at or near "SELECT" LINE 2: select
> name,ges_kw_zgb, SELECT round(100 * (ges_kw_zgb / (se...
Yes, you don't need all those SELECTs. You probably want something like
this:
select
name, ges_kw_zgb,
round(100 * (ges_kw_zgb / sum(ges_kw_zgb)), 2)
from
energie.tennet_auswertung_2010
group by
name, ges_kw_zgb;
Ray.
--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie
From | Date | Subject | |
---|---|---|---|
Next Message | salah jubeh | 2012-09-03 16:23:50 | Re: Create loop in postgresql |
Previous Message | Rainer Pruy | 2012-09-03 16:12:25 | Re: Create loop in postgresql |