Robert Fitzpatrick wrote:
> I am having a problem gettig a percent via division. Below is the
> first part of my trigger function where pct returns 0.00, instead of
> the expected 0.50. If I try without dimensions to the numeric
> variable, I just get 0. What is the correct way to accomplish the
> percent?
You are dividing an integer by an integer, and if the first integer is 1
then the result is often 0. You need to use numeric for your noreps
variable.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/