首页 > 数据库技术 > 详细

数据库-记录操作

时间:2019-03-07 16:24:15      阅读:136      评论:0      收藏:0      [点我收藏+]

记录操作

#
insert into 表名 values(),(),();

#
1.delete from 表名 where 条件;

2.delete from 表名 清空表;#如果设置成主键自增,则会接着增加

    truncate from 表名;即可
    
#
update 表名 set 字段=新的值 where 条件;

 

单表查询:

 

#单表查询语法
select distinct(去重) 字段名 from 表名  
                               where 条件
                               group by分组
                               having 筛选
                               order by排序
                               limit 限制条数
                               
#单表查询关键字顺序:
from#先找到表
where#根据条件取出记录
group by#将取出的数据进行group by
select#执行select去重
distinct
having#分组的结果在筛选
order by#再将结果进行排序
limit#限制条数

 

数据库-记录操作

原文:https://www.cnblogs.com/liuer-mihou/p/10490081.html

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