Re: Percentage of Total Occurances - Mailing list pgsql-sql

From Adam Sherman
Subject Re: Percentage of Total Occurances
Date
Msg-id 71610000.1050467913@saturn
Whole thread Raw
In response to Re: Percentage of Total Occurances  (<mallah@trade-india.com>)
List pgsql-sql
On 04/16/03 01:11:08 +0530 mallah@trade-india.com wrote:

>
>
> well if everything in a single query is that imp u may do this subselect:
>
>  select answer_id ,  1.0*count(*) / (select count(*) from polls where
> poll_id = ?)       from polls where poll_id = ? group by answer_id ;
>
> and if u need to trim the trailing digits after decimal
> do to_char(value , '99.99')
>
> since u have not provided any sample data i cann't test it.


Thanks for your help, this was simpler than I thought.

A.


--
Adam Sherman
Tritus CG Inc.
http://www.tritus.ca/
+1 (613) 797-6819



pgsql-sql by date:

Previous
From: Brad Hilton
Date:
Subject: Re: reversion? Recursion question
Next
From: "A.Bhuvaneswaran"
Date:
Subject: Re: What is the scope of a temp table?