操作表记录 :
增 :
- insert into 表名 (列1,列2) values (值1,值2);
删 :
-delete from 表名 where 条件 ;
-delete from 表名 ;删除表中所有的数据
- delete from 表名 where id >9 and id <20;
-truncate 表名 (没有where 条件)
区别 :
1. delete之后,插入数据从上一次主键自增加1开始, truncate则是从1开始
2. delete删除, 是一行一行的删除, truncate:全选删除 truncate删除的速度是高于delete的
查 ;
-select 列1,列2 from 表名 + where
改 :
-update 表名 set 列名1=新值1,列名2=新值2 where 条件;
---update 表名 set name= ‘xxx’ where id>20 and id<32;
相关文章:
-
2021-12-17
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2021-06-27
-
2022-12-23
-
2022-12-23
-
2021-11-22