Re: [GENERAL] dividing integers not producing decimal fractions

2006-11-05 Thread Martijn van Oosterhout
On Fri, Nov 03, 2006 at 02:03:59PM -0800, [EMAIL PROTECTED] wrote: > You're right (I dug around in the documentation and edjoocated myself). > However: > sales=# select 1/2::float; > ?column? > -- > 0.5 > (1 row) Note that in this case the "float" cast only applies to the last nu

Re: [GENERAL] dividing integers not producing decimal fractions

2006-11-04 Thread rloefgren
Alexander Staubo wrote: > On Nov 2, 2006, at 23:54 , [EMAIL PROTECTED] wrote: > > > I'm trying to produce a decimal fraction by dividing integer fields > > like this fragment of the query: > > > > ...((cntoh0.count + cntoh1.count)/ttl_deptcat.ttlcount) as "Ratio"... > ... > > How do I get fractions

Re: [GENERAL] dividing integers not producing decimal fractions

2006-11-03 Thread Alexander Staubo
On Nov 2, 2006, at 23:54 , [EMAIL PROTECTED] wrote: I'm trying to produce a decimal fraction by dividing integer fields like this fragment of the query: ...((cntoh0.count + cntoh1.count)/ttl_deptcat.ttlcount) as "Ratio"... ... How do I get fractions when dividing integers? Cast as something?

[GENERAL] dividing integers not producing decimal fractions

2006-11-03 Thread rloefgren
I'm trying to produce a decimal fraction by dividing integer fields like this fragment of the query: ...((cntoh0.count + cntoh1.count)/ttl_deptcat.ttlcount) as "Ratio"... I get this output dept_cat | cnt_oh_0 | cnt_oh_1 | sum_oh_0+1 | ttl_count | Ratio +--+--+-