oracle求最大值的函数吗_Oracle函数大全之聚合函数

count(*|[distinct|all]x)

【功能】统计数据表选中行x列的合计值。

【参数】

*表示对满足条件的所有行统计,不管其是否重复或有空值(NULL)

all表示对所有的值统计,默认为all

distinct只对不同的值统计,

如果有参数distinct或all,需有空格与x(列)隔开,均忽略空值(NULL)。

【参数】x,可为数字、字符、日期型及其它类型的字段

【返回】数字值

count(*)=sum(1)

【示例】

环境:

create table table3(xm varchar(8),sal number(7,2));

insert into table3 values('gao',1111.11);

insert into table3 values('gao',1111.11);

insert into table3 values('zhu',5555.55);

insert into table3 values('',1111.11);

insert into table3 values('zhu',0);

commit;

执行统计:

select count(*),count(xm),count(all xm),count(distinct sal),count(all sal),count(sal),sum(1) from table3;

结果:  5   4  4  3   5   5  5

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值