Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calculating a value in a query

Javier PFeb 10 2020 — edited Feb 10 2020

Hi

I would like to create a query from two tables to calculate a value

Table 1: Sales

Column: Sales_amount

Table 2: Returns

Column:  Return_amount

So I would like to create a query that returns the percentage return ratio where the percentage ratio is Sum(Return_amount) / (Sales_amount) and also being able to filter the query  by dates.

Can I do this in a single SQL Query or Do I need  to do a PL/SQL code

I would like to create a function where I can send the two dates range and receive the percentage.

What is the best way to do it?

Thanks for any help on this!

This post has been answered by Christian Pitet on Feb 10 2020
Jump to Answer
Comments
Post Details
Added on Feb 10 2020
12 comments
1,335 views