简答题:mysql5.5常用的语句有哪些?

1 选择:select * from table where 范围 2 插入:insert into table(field1,field2) values(value1,value2)3 删除:delete from table where 范围 4 更新:update table set field1=value1 where 范围 5 查找:select * from table where field1 like ’%value1%’6 排序:select * from ...
简答题:mysql5.5常用的语句有哪些?
1
选择:select * from table where 范围

2
插入:insert into table(field1,field2) values(value1,value2)

3
删除:delete from table where 范围

4
更新:update table set field1=value1 where 范围

5
查找:select * from table where field1 like ’%value1%’

6
排序:select * from table order by field1,field2 [desc]

7
总数:select count as totalcount from table

8
求和:select sum(field1) as sumvalue from table

9
平均:select avg(field1) as avgvalue from table

10
最大:select max(field1) as maxvalue from table

11
最小:select min(field1) as minvalue from table

12
例:

SELECT TOP 20 * FROM table

意思是:从table中查询前 20 项的全部内容

*可以用table中的内容表示

意思是:从table中查询前 20 项"某一项"的内容

SELECT SUM(grade) as total,average(grade) as average FROM table GROUP BY class

意思是:以班级为单位,查询这个班的总成绩和平均成绩

UPDATE table SET age=age+10

意思是:将 table 中所有人的年龄增加10岁2016-03-09
mengvlog 阅读 34 次 更新于 2025-08-11 13:58:48 我来答关注问题0
  • j88r 简答题:mysql5.5常用的语句有哪些

    1 选择:select * from table where 范围 2 插入:insert into table(field1,field2) values(value1,value2)3 删除:delete from table where 范围 4 更新:update table set field1=value1 where 范围 5 查找:select * from table where field1 like ’%value1%’6 排序:select * from tab...

  • MySQL常见版本包括4.1、5.0、5.1、5.5、5.6、5.7、5.8、8.0。5.6、5.7及5.8版本特性可参考OomSpot技术社区的介绍。版本4.1增加了子查询支持与UTF-8字符集,同时支持GROUP BY语句的ROLLUP功能,用于统计空值与非空值记录。版本5.0则引入了视图、存储过程、触发器、事件调度器、游标、全文...

  •  翡希信息咨询 MySQL server 5.5的安装 步骤图解

    一、下载 MySQL Server 5.5 访问官方下载页面:地址:MySQL 5.5 下载页面 在该页面上,选择你需要的 MySQL 5.5 版本进行下载。二、开始安装 运行安装程序:下载完成后,双击安装程序开始安装。选择安装类型:Typical(典型安装):按照默认设置进行安装。Custom(自定义安装):允许你选择安装的组件和路...

  •  Du知道君9361e mySQL的存储引擎

    MyISAMMySQL 5.0 之前的默认数据库引擎,最为常用。拥有较高的插入,查询速度,但不支持事务InnoDB事务型数据库的首选引擎,支持ACID事务,支持行级锁定, MySQL 5.5 起成为默认数据库引擎BDB源 自 Berkeley DB,事务型数据库的另一种选择,支持Commit 和Rollback 等其他事务特性Memory所有数据置于内存的...

  •  阿暄生活 开课吧T31项目第10天

    常见的连接池:DBCP、C3P0、Proxool、BoneCP、druid(阿里开源的JDBC)。连接池的工作原理:包括连接池的建立、连接池中连接的使用管理以及连接池的关闭。三、中间件的选型 消息队列消息传输过程中保存消息的容器,生产者和消费者不直接通信,依靠队列保证消息可靠性,避免系统的相互干扰。分类:P2P模式(生产...

檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部