您的位置:首页 > 博客中心 > 数据库 >

sql server 创建内联表值函数

时间:2022-03-10 17:03

表值函数就是返回table 的函数使用它可以方便的进行查询的处理

创建的代码如下:

create FUNCTION returunclassfirstlist

 -- Add the parameters for the function here
 
)
RETURNS TABLE
AS
RETURN
(
 -- Add the SELECT statement with parameter references here
 select * from classfirst;
)

我们在使用创建的函数的时候如下:

select * from returunclassfirstlist();
select * from returunclassfirstlist() where CONVERT(int,classid)<300;

注意 第二个 sql 就是说对于创建的表值函数我们可以进行数据的筛选

具体的数据就不粘贴了。

sql server 创建内联表值函数,布布扣,bubuko.com

热门排行

今日推荐

热门手游