Dividing Money

Поиск
Список
Период
Сортировка
От Bob Dusek
Тема Dividing Money
Дата
Msg-id Pine.LNX.3.96.981201135035.4461D-100000@temp.palaver.net
обсуждение исходный текст
Список pgsql-general
Hey all,

I have been trying to figure out how to divide a data field of type
'money'.  And, I've been unsuccesful.  So, I have a couple of questions to
ask.

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

(the first seven rows)

price
-------
$4.45
$2.95
$4.45
$2.95
$3.95
$3.95
$3.95

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

(the first seven rows)

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

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

Could someone explain this to me?

Thanks in advance,

Bob


В списке pgsql-general по дате отправления:

Предыдущее
От: "Michael A. Koerber"
Дата:
Сообщение: initdb v6.4 "pg_atoi" error
Следующее
От: ZioBudda
Дата:
Сообщение: better ?