![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mysql数据库
文章平均质量分 72
小豪学长啊
这个作者很懒,什么都没留下…
展开
-
MySQL语法复习--储存过程与储存函数
1.创建储存过程use mysql_test;drop procedure if exsits sp_update_sex;delimiter $$create procedure sp_update_sex(in cid int,in sex char(1))beginupdate customers set cust_sex = csex where cust_id =原创 2016-10-22 12:51:14 · 482 阅读 · 0 评论 -
MySQL语法复习--触发器与事件
1.班级表 class(班级号 classID, 班内学生数 stuCount)学生表 student(学号 stuID, 所属班级号 classID),要创建触发器来使班级表中的班内学生数随着学生的添加自动更新,代码如下:delimiter $$create trigger tri_student after insert on student for each rowbegin原创 2016-10-22 12:52:56 · 640 阅读 · 0 评论 -
MySQL逗号分割字段的行列转换技巧
前言: 由于很多业务表因为历史原因或者性能原因,都使用了违反第一范式的设计模式。即同一个列中存储了多个属性值(具体结构见下表)。这种模式下,应用常常需要将这个列依据分隔符进行分割,并得到列转行的结果。表数据:IDValue1tiny,small,big2small,medium3tiny,big转载 2016-10-24 20:21:42 · 548 阅读 · 0 评论