本文介绍了如何在sql中计算产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在我在表中使用了8个类别.. 每个类别都包含很多产品..... 如何计算sql中的产品...... i是使用2个表格的分类表和产品表 例如 类别 tomoto(5) orange(8) apple(4) 请有人帮我解决SQL查询
now i was using 8 category in the table.. each category include a many product..... how to count a product in sql... i was using 2 table a categorytable and product table for example category tomoto(5) orange(8) apple(4) please anybody help me in sql query
推荐答案在不知道您的确切表定义和样本数据的情况下,我们不能给你一个确切的答案。 但它可能与 Without knowing your exact table definitions, and sample data, we can't give you an exact answer. But it's probably along the lines of SELECT p.Name, Count(c.ID) FROM Products p JOIN Categories c ON p.CategoryID = c.ID GROUP BY p.Name
更多推荐
如何在sql中计算产品
发布评论