Re: [GENERAL] Calcuate percentage.

From: Sze Yuen Wong <swong_(at)yahoo(dot)com>
To: Marcin Grondecki <ojciec(at)mtl(dot)pl>, pgsql-general(at)hub(dot)org
Subject: Re: [GENERAL] Calcuate percentage.
Date: 1999-03-09 18:38:47
Message-ID: 19990309183847.7103.rocketmail@send202.yahoomail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


select count(*) into t2 from stations;
FATAL 1: btree: failed to add item to the right sibling

Any clue?

---Marcin Grondecki wrote:
>
> select count (*) into t1 from t;
> select count(varl), varl into t2 from t group by varl;
> select varl, (t2.count*100/t1.count) from t2, t1;
>
> and, of coz, drop tables t1 'n' t2 ;)
> (i don't know it's my laminess, but syntax "select ... into TEMP ddd
...
> does'n work for me - maybe suggestions? a bug i don't know about?)
>
> At 06:54 99-03-09 -0800, you wrote:
> >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
> >
> >
> >
> Marcin Grondecki
> ojciec(at)mtl(dot)pl
> +48(604)468725
> ***** I'm not a complete idiot, some parts are missing...
>
>
>

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

Browse pgsql-general by date

  From Date Subject
Next Message Dustin Sallings 1999-03-09 19:22:58 Re: [GENERAL] i want to start automaticly postgres when a reboot my server...help please.....
Previous Message Naceur 1999-03-09 18:22:42 Postgres tutorial examples !