首页 > 数据库技术 > 详细

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

时间:2016-12-15 20:47:46      阅读:242      评论:0      收藏:0      [点我收藏+]

分组去重查询,并执行某一个函数 :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中的字段

 

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

原文:http://www.cnblogs.com/zhaotiancheng/p/6184403.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!