MySQL基础(3) | 函数

MySQL基础(3) | 函数


前言

MySQL只有标量值函数的概念,没有SqlServer那种表值函数。

语法

  1. 创建
create function f_add(
	a int,
	b int
)
returns int
return 
	(select a + b);
	
select f_add(1, 2);
  1. 修改
alter function f_add()...
  1. 删除
DROP FUNCTION [ IF EXISTS ] <自定义函数名>

参考:http://c.biancheng.net/view/2590.html

posted @ 2020-02-23 11:38  iwsx  阅读(125)  评论(0编辑  收藏  举报