0
点赞
收藏
分享

微信扫一扫

sql-group by用法

TiaNa_na 2022-03-23 阅读 64
功能测试

group by:对数据进行分组,实现分类汇总

获取产品类别的单价合计

select CategoryName,ProductName,UnitPrice from northwind.categories right join northwind.products on northwind.categories.CategoryIDhahah =
northwind.products.CategoryID 

注意事项:

sql语句中包含了group by。那么,查询的字段要么作为分组的依据;要么是使用了聚合函数,不然会报错哦

 

举报

相关推荐

0 条评论