- 博客(5)
- 收藏
- 关注
原创 mysql学习笔记
substring(str,start,len)返回字符串从start位置起len个长度的字符串;lpad(str,n,pad)左填充 用字符串pad对str的左边进行填充,达到n个字符串长度;round(x,y)求参数x的四舍五入的值,保留y位小数;trim(str)去掉字符串头部和尾部的空格;mod(x,y) 返回x/y的模;rpad(str,n,pad)右填充;lower(str)全部转为小写;upper(str)全部转为大写;floor(x)向下取整;ceil(x)向上取整;
2025-03-26 08:41:52
135
原创 Mysql学习笔记
alter user ’用户名‘@’主机名‘ identified with mysql_native_password by '新密码';create user ‘用户名’@’主机名‘ identified by ’密码‘;revoke 权限列表 on 数据库名.表名 from ’用户名‘@’主机名‘;grant 权限列表 on 数据库名.表名 to ’用户名‘@’主机名‘;show grants for ’用户名‘@’主机名‘;drop user ’用户名‘@’主机名‘;主机名可以用通配符%
2025-03-25 11:34:08
200
原创 Mysql学习笔记
编写顺序:select 字段列表 from 表名列表 where 条件列表 group by 分组字段列表 having 分组后条件列表 order by 排序字段列表 limit 分页参数;select * from emp where gender='男' and age between 20-40 order by age asc,time acs limit 5;5,查询性别为男,且年龄在20-40岁(含)以内的前5个员工信息,对查询的结果按年龄升序排序,年龄相同按入职时间升序排序。
2025-03-25 11:01:43
350
原创 Mysql学习笔记
alter table 表名 change 旧字段名 新字段名 类型(长度)[comment 注释] [约束];alter table 表名 add/modify/change/drop/rename to……create table 表名(字段 字段类型,字段 字段类型)(最后一个字段类型不要加逗号);alter table 表名 rename to 新表名。alter table 表名 drop 字段名。DDL-数据库操作语句总结:;drop table 表名。修改字段名和字段类型;
2025-03-07 17:10:59
178
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人