I have a data table with the following:
Price | Date | Quantity
20 | 01-02 | 1
20 | 01-03 | 2
30 | 01-01 | 2
30 | 01-03 | 1
40 | 01-02 | 3
For each row, I would like to be able to multiple the value of the "Price" column with the same row's Quantity value, then sum those values, and return a single value to determine total revenue for the month.
Here is what I have, but I keep getting stymied:
select sum(
Select ("Price"*"Quantity") as "Subtotal") as "Total"
from Sales
where "Date" between '01/01/2016' and '01/31/2016';
However, this doesn't appear to do the trick. Does somebody know how I might tweak it to get the result I want?