<> 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,
VUE+Canvas Achieve desktop Pinball brick elimination games C/C++ Memory model 2019PHP Interview questions ( Continuously updated )PHPspringboot2 Separation of front and rear platforms ,token Put in header Pit for verification Vue SpringBoot conduct Excel download element-ui Step on pit record 45 The 12-year-old programmer was turned down , Is the workplace wrong ?Python Web frame Pandas Fundamentals of statistical analysis _ data processing (DataFrame Common operations )Java Misunderstanding —— Method overloading is a manifestation of polymorphism ?