I need to write a SELECT query for some users that will return a ratio. The math involved would just be the simple division of two numbers. However, they would like to have the ratio presented as a fraction rather than as a decimal. What is the best way to do that in SQL using Oracle 10g?
Share
You can define a function in Oracle to calculate greatest common divisor (taken from here):
And then use that function in your SQL to concatenate a fraction string: