插入值
insert into student value(按建表时的字段顺序填值)
批量插入
INSERT INTO 表名 (列1,列2,...) VALUES (值1,值2,...),(值1,值2,...);
省略部分字段插入值
INSERT INTO student set susername='1111',spassword='222',semail='3333',school='444';
删除值
delete from student where 字段名 = 值
修改
update 表名 set 字段名=新值,字段名=新值... where 字段名=值
查询
select * from 表名;查询所有表名
查询表中按某个字段排序的10条从0开始(不包括0)的1到10的数据
SELECT * FROM student ORDER BY sid limit 10 offset 0`
查询表中所有数据总数
select count(*) from student
模糊查询
SELECT * from app_info where appName like '%网%';
SELECT * FROM sp_ goods WHERE BRAND_ NAME LIKE CONCAT( %' ,name_ cn_ result,'%' );
虚拟表创建
create temporary table tmp_student select * from student where sname like "%包%";
select * from tmp_student
drop table tmp_student
创建视图
create view 表名 as select语句
删除视图 drop view if exists 表名
修改视图 alter view 视图名 as select语句
07-01
9万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交