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
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
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?
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
+--+--+-