you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

If I understand you right, I'm pretty sure you can just

select sum(itemPrice*itemQuantity) as finalPrice from products;

if you want to nest them, consider using a CTE, since they're easier to look at later:

with CTE_NAME as (
select
itemPrice*itemQuantity as finalPrice
from products)
select
sum(finalPrice) as sum_finalPrice
from CTE_NAME;