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

猜你喜欢

转载自www.cnblogs.com/iwsx/p/12348937.html
今日推荐