Re: [GENERAL] Calcuate percentage.

Поиск
Список
Период
Сортировка
От Sze Yuen Wong
Тема Re: [GENERAL] Calcuate percentage.
Дата
Msg-id 19990309150809.24512.rocketmail@send203.yahoomail.com
обсуждение исходный текст
Список pgsql-general
>
> select var1, count(*) from table1 group by var1;
>
> will get you the count of how many of each number there is...
>
> I think the only way is to get the max and manually loop thru the
rows and
> calc the percentage.


==>You mean externally using a programming ==>language
==>to do it?




>
> -----Original Message-----
> From: Sze Yuen Wong <swong_@yahoo.com>
> To: pgsql-general@hub.org <pgsql-general@hub.org>
> Date: Tuesday, March 09, 1999 9:48 AM
> Subject: [GENERAL] Calcuate percentage.
>
>
> >Hi,
> >
> > I need to calcuate the percentage from my table:
> >
> >var1
> >------
> >1
> >1
> >1
> >2
> >2
> >3
> >
> >Desire result:
> >
> >var1 |  percentage
> >----------------------------
> >1      |    50%
> >2      |    33%
> >3      |    17%
> >
> >===============================
> >
> >Any clue?
> >
> >Please help.
> >
> >Sze Wong
> >
> >
> >
> >
> >
> >
> >_________________________________________________________
> >DO YOU YAHOO!?
> >Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
>
>
>

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


В списке pgsql-general по дате отправления:

Предыдущее
От: "K.T."
Дата:
Сообщение: Re: [GENERAL] Calcuate percentage.
Следующее
От: Sze Yuen Wong
Дата:
Сообщение: Re: [GENERAL] Calcuate percentage.