<> inline table-valued functions

create function Function name (@ variable as type )
returns table
as
return
(
Result set [select Query statement ]
)
go

select Listing from Function name ( Pass in value )

<> Example Programming a custom function , Receive a parameter course number , Add one to the grade of each student in the course (1~5) Random fraction of .
create function addgrade1(@cno3 char(3)) -- Define function body returns table -- The return value is a table surface
as return select sno,cno,grade+(select left( datepart(ms, getdate()),1)/2+1)as
fraction from t_score go select * from addgrade1('C01')
–select left( datepart(ms, getdate()),1)/2+1
Because it can't be used in custom functions rand
Then define a random number 1>> Gets the millisecond of the current time >> Take the first bit of the second millisecond >> Divide this number by 2 again +1 We can get the range value we want

<> Multi statement table valued function

Technology
©2019-2020 Toolsou All rights reserved,
Error summary -myBatis plus paging use easyPOI Import Excel data In the problem of target detection “ recall Recall”,“ Accuracy Precision”vue use vue-clipboard2 Realize the function of copy link C In language switch sentence Wechat applet (uni-app)url Parameter transfer object hive compress &&hdfs Merge small files hive Summary of processing methods for a large number of small files use spring Of AntPathMatcher matching url route Linux Page replacement algorithm C Language implementation