Another Solution: Dividing Money

Started by Bob Dusekover 27 years ago2 messagesgeneral
Jump to latest
#1Bob Dusek
bobd@palaver.net

Well... well. uhhh well.

My feeble mind has managed to work out another very, very simple solution
to this:

select price, price / 2::float as halfprice from item_money;

All of my fretting and worrying, and the answer was that simple.

daggonnit,

Bob

#2Sferacarta Software
sferac@bo.nettuno.it
In reply to: Bob Dusek (#1)
Re: [GENERAL] Another Solution: Dividing Money

Hello Bob,

mercoled�, 2 dicembre 98, you wrote:

BD> Well... well. uhhh well.

BD> My feeble mind has managed to work out another very, very simple solution
BD> to this:

BD> select price, price / 2::float as halfprice from item_money;

BD> All of my fretting and worrying, and the answer was that simple.

BD> daggonnit,

BD> Bob

Which version of Postgres are you using?
on my v6.4 it works well:

rova=> select sal, sal/2 from emp;
sal |?column?
---------+---------
$1,600.00|$800.00
$2,850.00|$1,425.00
$950.00 |$475.00
$1,250.00|$625.00
$1,500.00|$750.00
$1,250.00|$625.00
(6 rows)

-Jose'-