Re: [GENERAL] Dividing Money

From: tolik(at)icomm(dot)ru (Anatoly K(dot) Lasareff)
To: Bob Dusek <bobd(at)palaver(dot)net>
Cc: PostgreSQL General <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] Dividing Money
Date: 1998-12-02 07:22:23
Message-ID: x7n257atzk.fsf@tolikus.hq.aaanet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>>> "BD" == Bob Dusek <bobd(at)palaver(dot)net> writes:

BD> When I query my database, using 'select price from item_money;', postgres
BD> returns just what I asked for....

BD> (the first seven rows)

BD> price
BD> -------
BD> $4.45
BD> $2.95
BD> $4.45
BD> $2.95
BD> $3.95
BD> $3.95
BD> $3.95

BD> When I query my database using the query 'select price::float as price
BD> from item_money', I get back some wierd stuff....

BD> (the first seven rows)

BD> price
BD> ----------
BD> 1080319164
BD> 1080319108
BD> 1080319052
BD> 1080318996
BD> 1080318940
BD> 1080318884
BD> 1080318828

BD> In my first query results, the first row is the same as the third row.
BD> And, the second row is the same as the fourth row. And, rows 5,6,7 are
BD> all the same. However, in the results returned from my second query,
BD> there are not any rows of equal value.... ???

Pehaps these are _different_ sets of records? Try

select oid, price from ....

and

select oid, price::float ....

oid is unique identifyer of row. Try also use explicit order of
records, '... order by price' or by any othe field.

--
Anatoly K. Lasareff Email: tolik(at)icomm(dot)ru
Senior programmer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sferacarta Software 1998-12-02 12:32:04 Re[2]: [GENERAL] Dividing Money
Previous Message ZioBudda 1998-12-01 21:55:28 insert or delete