> Can I somehow get the total number of rows in > a function? create function numRows() returns int4 as 'select count(*) from <table>' language 'sql'; > select var1, count(*) / numRows() * 100 from table1 group by var1; maybe this is better select var1, (count(*) * 100) / numRows() from table1 group by var1;
- [GENERAL] Calcuate percentage. Sze Yuen Wong
- Re: [GENERAL] Calcuate percentage. Marcin Grondecki
- Re: [GENERAL] Calcuate percentage. Clark Evans
- Re: [GENERAL] Calcuate percentage. Kaare Rasmussen
- Re: [GENERAL] Calcuate percentage. K.T.
- Re: [GENERAL] Calcuate percentage. Sze Yuen Wong
- Re: [GENERAL] Calcuate percentage. Sze Yuen Wong
- [GENERAL] Table as parameter in function Kaare Rasmussen
- Re: [GENERAL] Calcuate percentage. Kaare Rasmussen
- Re: [GENERAL] Calcuate percentage. Sze Yuen Wong