Replying to:
nentwined 20-Jan-05/11:14 AM
create or replace function voteaverage(int4) returns float as '
DECLARE
myavg float8;
BEGIN
myavg = 5+(float8(((avg(v.value)-5)))*(1/(1+exp(float8(3-count(v.value)/3))))) from votes v, poemranker_poems p WHERE v.poemid = $1 and v.poemid = p.id AND v.stamp > p.lastmod;
if myavg IS NULL THEN
return 5;
end if;
return myavg;
END;
' language 'plpgsql';

Captcha required for non-logged-in users




Track and Plan your submissions ; Read some Comics ; Get Paid for your Poetry
PoemRanker Copyright © 2001 - 2025 - kaolin fire - All Rights Reserved
All poems Copyright © their respective authors
An internet tradition since June 9, 2001