ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle group by与分组列为null空

oracle group by与分组列为null空

原创 Linux操作系统 作者:wisdomone1 时间:2012-12-19 18:56:31 0 删除 编辑
SQL> create table t_group(a int,b int);
Table created
SQL> insert into t_group values(null,1);
1 row inserted
SQL> insert into t_group values(null,2);
1 row inserted
SQL> insert into t_group values(1,2);
1 row inserted
SQL> insert into t_group values(3,2);
1 row inserted
SQL> commit;
Commit complete
SQL> select * from t_group;
                                      A                                       B
--------------------------------------- ---------------------------------------
                                                                              1
                                                                              2
                                      1                                       2
                                      3                                       2
SQL> select a,count(b) from t_group  group by a;
                                      A   COUNT(B)
--------------------------------------- ----------
                                                 2
                                      1          1
                                      3          1

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-751370/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: oracle hint_leading
请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12686044