I have a table in PostgreSQL (mixbest) with 73018 rows. The fields that I want to select are:
sample integer
m integer,
pciv double precision,
aggrec double precision
soil character(1)
I'm trying a SELECT but I get the following error SQLstate: 22003 numeric overflow. My select:
SELECT sample, m, 1-(EXP(SUM(LN(1-pciv)))) pciv, avg (aggrec) aggrec_avg, soil
FROM mixbest
GROUP BY sample, m, soil;
I know the problem is the EXP() due to I've tried the same select with the expression (SUM(LN(1-pciv)))) and I don't get the same error.
I tried to execute the select only in a few lines, and it works:
SELECT sample, m, 1-(EXP(SUM(LN(1-pciv)))) pciv, avg (aggrec) aggrec_avg, soil
FROM mixbest
WHERE sample< 4492 GROUP BY sample, m, soil;
Do you have any suggestion?
select max(pciv) from (SELECT sample, m, SUM(LN(1-pciv)) pciv, avg (aggrec) aggrec_avg, soil FROM mixbest GROUP BY sample, m, soil) t;gives?select max(pciv) from (SELECT sample, m, SUM(LN(1-pciv)) pciv, avg (aggrec) aggrec_avg, soil FROM mixbest GROUP BY sample, m, soil) t;is -16.1561356371564select min(pciv) from (SELECT sample, m, SUM(LN(1-pciv)) pciv, avg (aggrec) aggrec_avg, soil FROM mixbest GROUP BY sample, m, soil) t;?-8075.01457220042, maybe it is too small?