Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
You forgotten to take the quality in your calculation of the total amount. Muliplying the quantity by the dollarAmt should do the trickselect orderID, sum (dollarAmt * quantity) as totalfrom tablewhere orderID = 2group by orderID