Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

summation of record values

Status
Not open for further replies.

jenodorf

Technical User
Jan 11, 2005
36
0
0
Hi

have a mysql database running on the web. One table has stock quantity and stock cost. I need to show the total value of the stock held on a web administration page.

From the books/manuals and the web I think the fomat should be

SELECT Sum (Price * Stock)

But how do I specify the table?



thanks

Ian
 
Code:
Select sum (price * stock) as totalStockValue from tablename
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top