it is throwing "A"."AMOUNT": invalid identifier can anybody resolve this? : select s.sid,a.amount from sale s inner join (select saleid,sum((1-p.discount/100)*sd.quantity*p.price) "amount"  from saledetail sd inner join product p on sd.prodid=p.prodid group by sd.saleid) a on a.saleid=s.saleid 