如何在sql中计算产品

编程入门 行业动态 更新时间:2024-10-11 07:32:36
本文介绍了如何在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中计算产品

本文发布于:2023-11-22 01:23:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1615421.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   产品   sql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!