zhaotiancheng

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

 

分类:

技术点:

相关文章:

  • 2021-04-16
  • 2021-12-09
  • 2021-06-09
  • 2021-05-19
  • 2022-01-08
  • 2021-11-16
  • 2021-12-18
  • 2021-12-09
猜你喜欢
  • 2021-12-05
  • 2021-11-28
  • 2021-10-04
  • 2021-12-09
  • 2021-12-09
  • 2021-12-05
  • 2021-08-04
相关资源
相似解决方案