This project is read-only.


fn_max_val (Transact_SQL)

See also: fn_min_val, fn_avg_val

 


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

Syntax

 fn_max_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_man_val] ('John,Chris,Franck','TEXT')

Result

John

 

Other

none

Last edited Aug 29, 2012 at 2:10 PM by adudau, version 2

Comments

paragag Oct 20, 2012 at 8:52 AM 
Documentation needs correction
Example is wrong... should be
SELECT [Lib].[tsql].[fn_max_val] ('John,Chris,Franck','TEXT')