This project is read-only.

fn_last_val (Transact_SQL)

See also: fn_min_val, fn_max_val, fn_avg_val, fn_first_val


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

Syntax

fn_last_val(@list)

Arguments

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

Return type

NVARCHAR(MAX)

Remarks

none

Permissions

Public

Dependencies

none

Examples

SELECT [Lib].[tsql].[fn_first_val] ('John,Chris,Franck')

Result

Franck

Other

none


Last edited Sep 11, 2012 at 7:18 PM by adudau, version 1

Comments

paragag Oct 20, 2012 at 8:51 AM 
The example is documentation is wrong ..
it should be : SELECT [Lib].[tsql].[fn_last_val] ('John,Chris,Franck')

probably copy pasted.. but the result is right.