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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -