This project is read-only.


 

fn_avg_val (Transact_SQL)

See also: fn_min_val, fn_max_val

 


This scalar UDF returns the average value from a comma delimited list of numeric values.
 

Syntax

 fn_avg_val(@list,@compare_as) 

 

Arguments

@list = NVARCHAR(MAX) , string containing the list of values comma sepparated;

@compare_as = NVARCHAR(50), indicates if the values will be compared as string or numbers; values NUMBER or TEXT.

 

Return type

 

NVARCHAR(MAX)

Remarks

none

 

Permissions

Public

Dependencies

none

 

Examples

SELECT [Lib].[tsql].[fn_avg_val] ('1,2,3','NUMBER')

Result

Other

none

Last edited Aug 30, 2012 at 1:51 PM by adudau, version 1

Comments

No comments yet.