Oracle数据库,模糊查询、去重查询

分组去重查询,并执行某一个函数 :select  分组字段,聚合函数 from 表名 where 条件 group by分组字段 

select  分组字段,聚合函数 from 表名 where 条件 group by分组字段 having过滤条件

例:select cno, avg(degree) from score group by cno having count(sno)>=5;

  

 

模糊查询  : like

select * from 表名 where 字段 like   ‘字符串%’        表示字符串的后面可有可无,并没有字数限制

select * from 表名 where 字段 like    ‘字符串__’      表示字符串的后面必须有,并且有多少个下划线就有多少个字符

 

多个表之间的关联查询  :select 字段 from  表名n  jion   表名 m   on where   n.表1中的字段= m.表2中的字段

 

posted @ 2016-12-15 18:56  赵天成123  阅读(2104)  评论(0编辑  收藏  举报