X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C0D0547633C for ; Tue, 15 Apr 2003 13:11:36 -0400 (EDT) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 85B3047631A for ; Tue, 15 Apr 2003 13:11:21 -0400 (EDT) Received: (qmail 1644 invoked from network); 15 Apr 2003 17:13:41 -0000 Received: from ns1.trade-india.com (HELO www.trade-india.com) (66.234.10.14) by infocom-236-129-del.trade-india.com with SMTP; 15 Apr 2003 17:13:41 -0000 Received: (qmail 4619 invoked by uid 99); 15 Apr 2003 17:10:37 -0000 Received: from 219.65.253.230 (SquirrelMail authenticated user mallah) by mail.trade-india.com with HTTP; Tue, 15 Apr 2003 22:40:37 +0530 (IST) Message-ID: <1177.219.65.253.230.1050426637.squirrel@mail.trade-india.com> Date: Tue, 15 Apr 2003 22:40:37 +0530 (IST) Subject: Re: Percentage of Total Occurances From: To: In-Reply-To: <6790000.1050418432@saturn> References: <6790000.1050418432@saturn> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: X-Mailer: SquirrelMail (version 1.2.6) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-14.4 required=5.0 tests=BAYES_10,IN_REP_TO,MISSING_MIMEOLE,MISSING_OUTLOOK_NAME, NO_REAL_NAME,REFERENCES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/233 X-Sequence-Number: 12934 > I have a table being used for poll results: > > id > poll_id > question_id > answer_id > datestamp > > I what to figure out the percentage or respondants that gave each answer.= This is based on > occurance rather than values. select answer_id,count(*) from polls where poll_id =3D ? group by answer_id ; gives number of response of each answer total_response =3D select count(*) from polls where poll_id =3D ? getting %age shud be trivial. Dunno if i missed your question . > > I want to be able to figure it out for a single (poll_id,qustion_id) com= bination and also for > multiple questions. > sorry i do not get it. > Thanks for your help, > > A. > > > -- > Adam Sherman > Tritus CG Inc. > http://www.tritus.ca/ > +1 (613) 797-6819 > > > ---------------------------(end of broadcast)--------------------------- = TIP 4: Don't 'kill -9' > the postmaster ----------------------------------------- Get your free web based email at trade-india.com. "India's Leading B2B eMarketplace.!" http://www.trade-india.com/