码迷,mamicode.com
首页 > 其他好文 > 详细

修改表中数据

时间:2017-06-25 14:21:01      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:排序   ice   ble   格式   top n   percent   语法   drop   分组   

修改表中数据
格式:
update+表名+set+列名=‘表达式‘+where 条件表达式
update student set name=‘李四‘ where name =‘43‘
删除表中数据
格式:
delete + from + 表名 +where 条件表达式
说明:当选项缺省时,删除表中所有数据
delete from student where csrq=‘1998-1-1‘
或者:
格式:
truncate +table +表名
功能:删除表中所有数据
删除表:
drop table 删除表定义及该表的所有数据
语法:
drop table table_name
查询语句
where 查询条件
group by 分组查询
select brand, max(price) from car group by brand 这是通过分组查询
意思是通过brabd进行分组,现在是分成好几个组, 然后通过最高的价格摘出来,相当于把每个牌子的最高价格的车型拿了出来。
分组查询必须跟着函数 这就是函数 max(price)
having 筛选查询
order by 排序
选择特定列
select __ , __ from student
去重查询
distinct语句:
select distinct brand from car
top 句子:
top n [percent] 可以用于查询前几列的数据

修改表中数据

标签:排序   ice   ble   格式   top n   percent   语法   drop   分组   

原文地址:http://www.cnblogs.com/yunpeng521/p/7076634.html

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