![]() |
[SQL] Aggregate Functions
I'm currently working on a lab for my database class and I've run into a snag. The problem is as follows:
Quote:
Code:
SELECT SUM (ProductQuant*ProductCost) 'Inventory Value', AVG (ProductCost) 'Average Product Cost', (ProductQuant*ProductPrice) 'Potential Lost Revenue' Quote:
|
I GOT IT! The following code yielded the proper results:
Code:
SELECT SUM (ProductQuant*ProductCost) 'Inventory Value', AVG (ProductCost) 'Average Product Cost', SUM (ProductQuant*ProductPrice) 'Potential Lost Revenue' |
All times are GMT -8. The time now is 05:25 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project