Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 281369FC408 for ; Fri, 29 Jun 2007 23:14:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 63698-08 for ; Fri, 29 Jun 2007 23:13:48 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 858CD9FB2FF for ; Fri, 29 Jun 2007 23:14:05 -0300 (ADT) Received: (qmail invoked by alias); 30 Jun 2007 02:14:03 -0000 Received: from i3ED6D614.versanet.de (EHLO [192.168.0.112]) [62.214.214.20] by mail.gmx.net (mp029) with SMTP; 30 Jun 2007 04:14:03 +0200 X-Authenticated: #14269776 X-Provags-ID: V01U2FsdGVkX18vEsdBhvMvOjqdNFfzGaVV4qw3kPSsOQdmjRnyh9 N1eeelOaRcXU+5 Message-ID: <4685BC84.2090106@gmx.net> Date: Sat, 30 Jun 2007 04:14:28 +0200 From: Andreas User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.8.1.4) Gecko/20070509 SeaMonkey/1.1.2 MIME-Version: 1.0 To: PostgresSQL list Subject: percentages of a column Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/244 X-Sequence-Number: 28734 Hi, There is a Select that calculates some SUMs of objects. I'd like to show a list of counts and percentages of this counts based on the sum of all counts. Is that possible in a SELECT statement? Example: Fruit Count % -------------------------- Bananas 5 10% Apples 15 30% Oranges 30 60%