sql server 创建函数
资料
https://docs.microsoft.com/zh-cn/sql/relational-databases/user-defined-functions/create-user-defined-functions-database-engine?view=sql-server-2017
https://www.cnblogs.com/ABblog/p/5660610.html
-- SELECT *from wzh_demo1 CREATE FUNCTION mydemo1(@aaa varchar(20)) RETURNS @table table(id int ,book VARCHAR(20),descript VARCHAR(20),money_ VARCHAR(20), author VARCHAR(20)) as BEGININSERT into @table(id,book,descript,money_,author)SELECT * from wzh_demo1 where book=@aaareturn
end
运行函数效果