Re: Re: function to operate on same fields, different records?

From: "Eric G(dot) Miller" <egm2(at)jps(dot)net>
To: PostgreSQL-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Re: function to operate on same fields, different records?
Date: 2001-03-31 02:37:40
Message-ID: 20010330183740.D29151@calico.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 30, 2001 at 06:49:51PM -0600, will trillich wrote:
> On Fri, Mar 30, 2001 at 12:27:39AM -0500, Gregory Wood wrote:
> > > SELECT sum(grade) / count(grade) As GPA FROM grades;
> > > ^^^^ (bad juju if 0)
> >
> > No kidding... that kid totally failed ALL his classes! And before someone
> > points it out, yes I saw the DBZ.
>
>
> dbz?

Division By Zero. Also, the above would perform integer division, would
need a cast to 'float8' on one of the operands.

--
Eric G. Miller <egm2(at)jps(dot)net>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eric G. Miller 2001-03-31 03:29:56 Re: dynamic field names in a function.
Previous Message Eric G. Miller 2001-03-31 02:34:45 Re: function to operate on same fields, different records?