MySQL 基础语句

MySQL 基础语句

多个知识点

------------------------------------------------------------------------------------------------------------------------------------------------------------

  • 排序:order by  desc-降序   asc-升序(默认)

select * from student order by stuno desc

  • distinct 去掉重复的值

select distinct classno from student

----------------insert----------------------------
select * from student
insert into student values('03000001','20102010','梁帅','abxdefgh')

-----------------update--------------------------
update student set stuname='梁帅帅' where stuname='梁帅'

-------------------delete----------------------------
delete 删除表中所有的记录,保持表的结构
delete table_name
-------------------drop------------------------
drop 完全删除表
drop table_name

上一篇:快捷切换hosts的小工具:SwitchHosts!


下一篇:MySQL基础(五)——视图