MySQL基础(3) | 函数
MySQL基础(3) | 函数
前言
MySQL只有标量值函数的概念,没有SqlServer那种表值函数。
语法
- 创建
create function f_add(
a int,
b int
)
returns int
return
(select a + b);
select f_add(1, 2);
- 修改
alter function f_add()...
- 删除
DROP FUNCTION [ IF EXISTS ] <自定义函数名>