Re: Percentage of Total Occurances

Поиск
Список
Период
Сортировка
От Adam Sherman
Тема Re: Percentage of Total Occurances
Дата
Msg-id 71610000.1050467913@saturn
обсуждение исходный текст
Ответ на Re: Percentage of Total Occurances  (<mallah@trade-india.com>)
Список 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 по дате отправления:

Предыдущее
От: Brad Hilton
Дата:
Сообщение: Re: reversion? Recursion question
Следующее
От: "A.Bhuvaneswaran"
Дата:
Сообщение: Re: What is the scope of a temp table?