RSS Feed

Choose

Choose

Choose: It is a function that will choose the value at the specified index from a list of values. It takes parameters in which first parameter would be the Index, and rest all can be the list of values.

Syntax of Choose:

CHOOSE (index, val_1, val_2 [, val_n ] )

Example of Choose:

SELECT CHOOSE( 2,'Amit','Sanjiv','Dino','Teji')AS OutPut_Result;

The Output will be Sanjiv.

For complete post go to SQL Server 2012 Enhancements.