mysql高级函数

mysql高级函数,第1张

1.select concat(name, money) from account:拼接字段

2.select length(name) from account:查询字节长度(根据编码集utf-8,一个汉字占三个字节)

3.select ifnull(money, 10) from account:如果money为null,显示10

4.select round(money,1) from account:保留一位小数四舍五入

5.select floor(money) from account:向下取整

6.select ceil(money) from account:向上取整

7.select truncate(money, 1) from account:截断(截取一位小数)

8.select mod (10, 3):取余(相当于select 10%3)

9.select upper(name) from account:将名字变成大写

10.select lower(name) from account:将名字变成小写

11.select substring(name, 1) from account:截取名字下标从1开始的所有字段(注意:mysql的下标都是从1开始)

12.select substring(name, 1, 4) from account:截取名字下标从1开始,长度为4的字段

13.select now():返回当前系统的日期和时间

14.select curdate():返回当前系统的日期

15.select curtime():返回当前系统的时间

16.select date_format(now(), '%Y年%m月%d日') as '当前时间':将时间转换成字符串

17.select count(name) from account:计算name的个数(忽略null)

18.select count( ) from account:计算个数(不忽略null,类似:select count(1) from account)

19.select lpad(name, 10, ' '), money from account:指定字段在左边填充到指定长度(rpad:右边填充)

20.select replace(name, 'an', '*'), money from account:替换指定字段

21.select * from user limit 0,5:查询前5条数据(下标0开始,数量:(page - 1) * size, size)

22.select * from boy union select * from girl:两个结果合成一个(会自动去重,不去重用:union all)

1.select sum(money) from account:求和(忽略null,null和任何值相加都为null)

2.select sum(money) from account:求平均数(忽略null)

3.select max(money) from account:求最大值(忽略null)

4.select min(money) from account:求最小值(忽略null)

5.select name, money, if(money is null, '呵呵', '哈哈') 备注 from account:if语句

6.case条件语句

1.create table copy like user:复制user表(只复制表的字段)

2.create table copy select * from user:复制user表(字段数据一起复制)

3.create table copy select username,age from user:复制user表(复制指定的字段,数据一起复制)

4.create table copy select username,age from user where 0:复制user表(复制指定的字段,数据不复制)

5.alter table 表名 add|drop|modify|change column 列名【列类型 约束】:修改表

1.等值连接:select s.studen, t.teacher from study s, teacher t where s.t_id = t.id(求交集部分)

1、mysql记录存储:mysql的数据是怎么组织的

2、页内记录的维护(顺序保证/插入策略/页内查询)

3、MySQL内存管理(页面管理、页面淘汰、LRU):全表扫描对内存有什么影响? 如何避免热数据被淘汰? 没有空闲页怎么办?

4、InnoDB 加锁的过程是如何实现的?常见锁问题有那些?

5、MVCC是什么?如何实现多版本控制?如何解决写冲突?

6、回滚日志Undo log如何实现多版本控制与保证事务的原子性?

7、undo log如何清理,为何InnoDB select count(*)  这么慢?

8、重做日志Redo log如何实现事务持久性?

9、InnoDB行级锁、间隙锁、表级锁如何实现的?

10、InnoDB加锁过程如何实现的?

11、海量数据下 主键如何设计?

12、聚集索引、二级索引与联合索引具备哪些特点?

13、在进行索引优化时应该注意哪些问题/

14、MySQL如何进行库表的优雅设计?

15、如何实现数据备份之延时库部署

16、MySQL如何高效实现数据冗余部署

17、MySQL高可用方案有哪些

并不都是免费的。

1、MySQLCommunityServer社区版本,开源免费,但不提供官方技术支持。

2、MySQLEnterpriseEdition企业版本,需付费,可以试用30天。

3、MySQLCluster集群版,开源免费。可将几个MySQLServer封装成一个Server。

4、MySQLClusterCGE高级集群版,需付费。

扩展资料

关于mysql的系统版本:

WindowsEssentials(x86)6.0.7:Essentials精简,精简版-去除了实例文件。

WindowsZIP/Setup.EXE(x86)6.0.7:自动安装版,下载下来后是个zip包,解压后有个setup.exe,可以直接运行安装。

Withoutinstaller(unzipinC:\)6.0.7:installer压缩版-绿色免安装版,解压后是程序文件,甚至相当于运行setup.exe后的样子,需要自己手动配置。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6136613.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-16
下一篇 2023-03-16

发表评论

登录后才能评论

评论列表(0条)

保存