SUM是对符合条件的记录的数值列求和

COUNT 是对查询中符合条件的结果(或记录)的个数

例如:

表fruit

id     name    price

1     apple     3.00

2     pear       4.00

select count(price) from fruit; ----执行之后结果为:2  (表示有2条记录)

select  sum(price) from fruit;---执行之后结果为:7:00(表示各记录price字段之和为7.00)

相关文章:

  • 2021-10-02
  • 2021-10-13
  • 2021-10-02
  • 2021-08-24
  • 2022-01-01
  • 2022-12-23
  • 2021-10-02
猜你喜欢
  • 2021-11-13
  • 2022-12-23
  • 2021-10-02
  • 2021-07-16
  • 2022-12-23
  • 2021-12-11
相关资源
相似解决方案