fn_nth_val (Transact_SQL)

See also:


This scalar UDF returns the value of the element at position n in a list.

Syntax

fn_nth_val(@list)

Arguments

@list = NVARCHAR(MAX), list of numeric values to calculate the median for.

@no = BIGINT, position to look for a value.

 

Return type

NVARCHAR(MAX)

Remarks

none

Permissions

Public

Dependencies

none

Examples

SELECT [tsql].[fn_nth_val] ('a,b,c,f','3')

Result: 'c'

 

Other

none


Last edited Sep 14, 2012 at 7:58 PM by adudau, version 1

Comments

No comments yet.