当前位置:网站首页>[MySQL learning notes 28] storage function
[MySQL learning notes 28] storage function
2022-07-01 07:34:00 【yqs_ two hundred and eighty-one million eight hundred and seven】
Stored functions are very similar to stored procedures , See :【mysql Learning notes 27】 stored procedure
The storage function has a return value , And the parameter can only be in type
grammar :
CREATE FUNCTION Function name ([ parameter list ])
RETURNS type [characteristic...]
BEGIN
--- SQL sentence
RETURN ...;
END;
characteristic( characteristic ):
- DETERMINISTIC: The same input parameters always produce the same results
- NO SQL: It doesn't contain SQL sentence
- READS SQL DATA: Contains query statements but no write statements
Example
--- Return from 1 To n The cumulative value of
create function sum(n int)
returns int deterministic
begin
declare total int default 0;
while n>0 do
set total:=total+n;
set n:=n-1;
end while;
return total;
end;
边栏推荐
- Is the account opening of GF Securities safe and reliable? How to open GF Securities Account
- Image style migration cyclegan principle
- ONES 创始人王颖奇对话《财富》(中文版):中国有没有优秀的软件?
- 【R语言】年龄性别频数匹配 挑选样本 病例对照研究,对年龄性别进行频数匹配
- Custom events of components ②
- Custom events of components ①
- How to create an exclusive vs Code theme
- Reply and explanation on issues related to "online training of network security education in 2022"
- [target detection] yolov5, the shoulder of target detection (detailed principle + Training Guide)
- 电脑有网络,但所有浏览器网页都打不开,是怎么回事?
猜你喜欢

微软宣布开源 (GODEL) 语言模型聊天机器人

【深圳IO】精确食品称(汇编语言的一些理解)

2022 mobile crane driver test exercises and online simulation test
![[Shenzhen IO] precise Food Scale (some understanding of assembly language)](/img/8c/1e64401e812538d8606df557054355.png)
[Shenzhen IO] precise Food Scale (some understanding of assembly language)

【编程强训2】排序子序列+倒置字符串

她就是那个「别人家的HR」|ONES 人物
![Those high-frequency written tests and interview questions in [Jianzhi offer & Niuke 101] - linked list](/img/9a/44976b5df5567a7aff315e63569f6a.png)
Those high-frequency written tests and interview questions in [Jianzhi offer & Niuke 101] - linked list

base64

LeetCode+ 71 - 75

atguigu----脚手架--02-使用脚手架(2)
随机推荐
iNFTnews | 从《雪崩》到百度“希壤”,元宇宙30年的16件大事
如何让两融交易更极速
华泰证券开户是安全可靠的么?怎么开华泰证券账户
Understanding of Turing test and Chinese Room
C语言实现【三子棋游戏】(步骤分析和实现源码)
C # read and write customized config file
手机开户选哪个证券公司比较好,哪个更安全
base64
Eigen矩阵运算库快速上手
Is it safe to do fund fixed investment on Great Wall Securities?
MySQL and redis consistency solution
【编程强训2】排序子序列+倒置字符串
kubernetes资源对象介绍及常用命令(二)
在券商账户上买基金安全吗
【Flutter 问题系列第 72 篇】在 Flutter 中使用 Camera 插件拍的图片被拉伸问题的解决方案
Is it reliable to open an account on the compass with your mobile phone? Is there any potential safety hazard
PWN攻防世界int_overflow
【技能】创建.bat快速打开网页
Unity2021-Scene视图中物体无法直接选中的解决办法
【mysql学习笔记28】存储函数