1、查询数组并去重 用distinct()函数
select distinct(字段名) from 表名
2、count(*) 和 sum()
(1)、count(*) 函数是用于统计数据的条数
select count(*) as count from A where id>0
(2)、sum() 统计某个字段的值之和(计算字段为num的数值之和)
select sum(num) as num from A
1、查询数组并去重 用distinct()函数
select distinct(字段名) from 表名
2、count(*) 和 sum()
(1)、count(*) 函数是用于统计数据的条数
select count(*) as count from A where id>0
(2)、sum() 统计某个字段的值之和(计算字段为num的数值之和)
select sum(num) as num from A