?
Solved

how to cast result as float/double

Posted on 2009-02-08
1
Medium Priority
?
1,600 Views
Last Modified: 2012-05-06
Here is part of my select statement:

((sum(totalflopbets)+sum(totalturnbets)+sum(totalriverbets))/
(sum(totalflopcalls)+sum(totalturncalls)+sum(totalrivercalls))) as agg,

Currently 'agg' is returned as an integer. I want it to be a float or double (anything with 1-2 decimal places.)

Thanks!
0
Comment
Question by:alanbergin
1 Comment
 
LVL 1

Accepted Solution

by:
akanand earned 200 total points
ID: 23583753
Hi!
 (cast(item1 as float)) cast any number to float. Better cast every individual item to float before putting it into the result.

~Amar
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question