We help IT Professionals succeed at work.

Dividing one int type column by another int column and returning a numeric value for a list

kenv611
kenv611 asked
on
How is the best way to divide an int column by another int column and returning a numeric value for a set of records (one operation per row) such as

select col1, col2, col2/col1 * 100 as col3
Comment
Watch Question

Senior .Net Developer
BRONZE EXPERT
Commented:
that is fine . . . if you're looking for a % then just cast them as numbers:

select col1, col2, cast (col2 as number(18,2)) / cast (col1 as number(18,2)) * 100 as col3

Explore More ContentExplore courses, solutions, and other research materials related to this topic.