Re: [GENERAL] weird sum() results

From: Jose Soares <jose(at)sferacarta(dot)com>
To: Hitesh Patel <hitesh(at)presys(dot)com>
Cc: "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] weird sum() results
Date: 2000-01-21 14:08:11
Message-ID: 3888684A.35294653@sferacarta.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You have to create a function to cast money to float.
Try the attached functions.

José

Hitesh Patel wrote:

> I can understand that. What's weird is that I can do a sum(amount) on
> the whole table and the value comes out to only My only problem is that
> the amount field is the money type and doesn't like the casting now. A
>
> SELECT SUM(amount::float8) FROM table where state = 'CA';
>
> returns
>
> ERROR: No such function 'float8' with the specified attributes
>
> And again i'm stuck :-)
>
> Thanks in advance for any help.
> --
> |---------------------------------|----------------------------|
> | Hitesh Patel | Voice: (541) 759-3126 |
> | Facilities Development Manager | Fax: (541) 759-3214 |
> | Preferred Systems | Email: hitesh(at)presys(dot)com |
> |---------------------------------|----------------------------|
>
> ************

Attachment Content-Type Size
money.sql text/plain 10.6 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Konrad.Pscheidl 2000-01-21 15:11:20 pg_log
Previous Message Jose Soares 2000-01-21 13:50:02 Re: [GENERAL] Re: weird sum() results