当前位置:网站首页>MySQL storage and custom functions
MySQL storage and custom functions
2022-06-26 07:05:00 【Rorschach379】
select col_name,
case when char_length(col_intro)>20 then
concat(left(col_intro,20),'.....')
else col_intro end
from tb_college;
drop function if exists truncate_string;
delimiter $
create function truncate_string(
content varchar(12000),
max_length int unsigned
)
returns varchar(12000) no sql
begin
declare result varchar(12000)default content;
if char_length(content)>max_length then
set result=concat(left(content,max_length),'.....');
end if;
return result;
end $
delimiter ;
select col_name,
truncate_string(col_intro,20)
from tb_college;
delimiter $
create procedure sp_upgrade_emp_sal()
begin
start transaction;
update tb_emp set sal=sal+100 where dno=10;
update tb_emp set sal=sal+200 where dno=20;
update tb_emp set sal=sal+300 where dno=30;
commit;
end$
delimiter ;
call sp_upgrade_emp_sal();
delimiter $
create procedure sp_get_avg_sal(
in dept_no int,
out avg_sal decimal(10,2)
)begin
select round(avg(sal),2) into avg_sal
from tb_emp where dno=dept_no;
end $
delimiter ;
call sp_get_avg_sal(10,@sal);
select @sal;
边栏推荐
- Hudi compilation of data Lake architecture
- Redis系列——5种常见数据类型day1-3
- Research Report on China's surfactant market demand and future investment opportunities 2022
- Network IO, disk IO
- $a && $b = $c what???
- Deep exploration image theme color extraction
- 专业课-代码题记录
- Solve the problem of transparency at the bottom of dialog
- I caught a 10-year-old Alibaba test developer in the company. After chatting with him, I realized everything
- QPS
猜你喜欢
![Meso tetra (4-bromophenyl) porphyrin (tbpp); 5,10,15,20-tetra (4-methoxy-3-sulfonylphenyl) porphyrin [t (4-mop) ps4] supplied by Qiyue](/img/83/ddbf296ac83f006f31cfd0bbbabe5e.jpg)
Meso tetra (4-bromophenyl) porphyrin (tbpp); 5,10,15,20-tetra (4-methoxy-3-sulfonylphenyl) porphyrin [t (4-mop) ps4] supplied by Qiyue

【图像融合】基于耦合特征学习的多模式医学图像融合附matlab代码
![[image segmentation] blood vessel extraction from retinal fundus images based on maximum principal curvature with matlab code](/img/10/3cef095ae5834bbbe51ef16b5c9f78.png)
[image segmentation] blood vessel extraction from retinal fundus images based on maximum principal curvature with matlab code

MySQL (III)

Ppbpi-h-cr, ppbpimn Cr, ppbpi Fe Cr alkynyl crosslinked porphyrin based polyimide material Qiyue porphyrin reagent

Massive log collection tool flume

STM32F1与STM32CubeIDE编程实例-热敏传感器驱动
![[path planning] robot path planning based on improved artificial potential field with matlab code](/img/82/b4cfb84de1cd56abe0c51205e99035.png)
[path planning] robot path planning based on improved artificial potential field with matlab code

一项听起来大胆,并且非常牛逼的操作——复刻一个 Netflix

一文深入底层分析Redis对象结构
随机推荐
Analyze 5 indicators of NFT project
Thymeleaf中使用二维数组[[]]报错:Could not parse as expression
China peek market outlook and future strategic planning proposal report 2022-2027
Massive log collection tool flume
OCA Security Alliance (cybersecurity mesh)
MySQL (III)
es 中 mapping 简介
Crosslinked metalloporphyrin based polyimide ppbpi-h) PPBP Mn; PBP-Fe; PPBPI-Fe-CR; Ppbpi Mn CR product - supplied by Qiyue
I have been testing at Tencent for several years
MySQL
MATLAB线性规划模型学习笔记
ZRaQnHYDAe
Mysql操作数据库
[004] [stm32] MDK project configuration and commissioning
3,3 '- di (3,4-dicarboxyphenoxy) -4,4' - diphenylethynylbiphenyldianhydride (bpebpda) / porphyrin 2dcofs (H2P COF, ZNP COF and cup COF) supplied by Qiyue
Redis系列——5种常见数据类型day1-3
异地北京办理居住证详细材料
5,10,15,20-tetra (4-bromophenyl) porphyrin (h2tppbr4) /5.2.15,10,15,20-tetra [4-[(3-aminophenyl) ethynyl] phenyl] porphyrin (tapepp) Qiyue porphyrin reagent
两水先木示身为Unity3D职场人的个人觉悟
快速找到优质对象的5种渠道,赶紧收藏少走弯路