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@xxxxxx -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general