sql - mysql adding total price of certain products -


Hello I am having trouble in querying a product table at this time:

Let me show it to The total cost of all HP and Tashiba products is required ..

In this way I have tried so far

  SELECT * products with WHERE prod_id '__hp%' and SELECT SUM value) Total from products;  

Any help would be appreciated

This is a picture of the table of products - >>

Thanks;

If you are making clear that the third and fourth characters of Prod_ID are a manufacturer code, then you May help themselves a lot. HP and TA for Toshiba. SELECT SUBSTRING (prod_id, 3,2), SUM (value * on_hand) WHERE SUBSTRING (prod_id, 2,1) IN ('TA', 'HP') Assembling by group (prod_id) , 3,2)


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -