sosidge Posted February 2, 2005 Share Posted February 2, 2005 Hi there, I'm trying to quickly find out the total value of stock of hold at present. I imagine there is an easy way to do this with an operation on the MySQL database - but I don't know where to start. Basically, in the products table, I need products_quantity to be multiplied by products_price for each products_id, and for the whole lot to be summed. Any help much appreciated. - osCommerce is fun! - Link to comment Share on other sites More sharing options...
peterr Posted February 2, 2005 Share Posted February 2, 2005 Hi, I forget the column names, but a wild guess ......: SELECT SUM(products_quantity * products_price) AS stockTotValue from products; Peter Link to comment Share on other sites More sharing options...
sosidge Posted February 2, 2005 Author Share Posted February 2, 2005 That's a pretty good wild guess... got the exact result I wanted... thanks a lot! - osCommerce is fun! - Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.