码迷,mamicode.com
首页 > 数据库 > 详细

关于sql语句

时间:2020-05-13 12:11:21      阅读:67      评论:0      收藏:0      [点我收藏+]

标签:value   更新   sql   like   and   val   group   esc   复数   

//增加
insert into  a(name,score) values()
//删除
delete from biao where 字段
truncate biao
//更新数据
update biao set 字段=新
//查询数据
select ziduan from biao where tiaojian
//查询所有
select from biao
//使用别名
select ziduan as ‘‘,ziduan2 from biao
//where条件
select*from biao where ziduan1 and ziduan2
//between and
select * from biao where ziduan between and
//空条件查询
select * from biao where ziduan IS Null
//模糊查询
select * from biao where ziduan like ‘%w%‘
//去除重复数据
select distinct ziduan from biao
//排序
select * from biao order by lieming asc/desc
//聚合查询
select count(lieming)tiaojian  from biao;
select  min(lieming)tiaojian  from biao;
select max() tiaojianfrom biao;
select  avg() tiaojianfrom biao;
select sum() tiaojianfrom biao;
//分组查询
select count(lieming) boys from ziduan group by tiaojian;
//筛选条件后使用
select count(lieming) boys from ziduan group by tiaojian having;

关于sql语句

标签:value   更新   sql   like   and   val   group   esc   复数   

原文地址:https://www.cnblogs.com/mmore123/p/12881328.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!