- 博客(3)
- 收藏
- 关注
原创 distinct和group by
distinct的统计维度在他之后,如果在distinct后接count或者sum,统计出来的数据只会有一条,对比group by 统计维度也在他之后,不过可以搜索出多个维度的count或者sum。部门&金额维度:select sum(money),org from tst11 group by org,money;部门维度:select sum(money),org from tst11 group by org;第一个搜出来的结果是2,第二个搜出来的结果是3,1。
2022-10-22 14:47:43 294 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人