oracle基础知识点

一、count(*)、count(1)、count(字段名)的区别
select count(*) from t_md_inst --153797 --包含字段为null 的记录
select count(1) from t_md_inst ---153797 --包含字段为null 的记录
select count(class_id) from t_md_inst --19883 --不包含class_id是null的记录
select count(distinct class_id) from t_md_inst --29 ---不显示class_id重复的记录

二、group  by + having +  order by

select quote_class, quoteed_type
  from t_meta_quote
    group by quote_class, quoteed_type
       having quote_class != 'DDIndex'
            order by quoteed_type desc, quote_class asc;

三、||连接符:连接字段和字符串

四、distinct两个字段的去重

五、伪列、别名、is null、like

 

猜你喜欢

转载自www.cnblogs.com/diandixingyun/p/11593266.html