SQL Server 2008 R2 table query -


i have 2 tables. need execute query gets name of product has letter m in , sort these products in descending order number of ingredients have.

product table has name , product number in it, while table madefrom has ingredient number , product number in it.

something this:

select name, count(madefrom.id) product     inner join madefrom on madefrom.productid = product.id name '%m%' group name order count(madefrom.id) desc 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -