What is choose function in Denali? Explain with example.

 Posted by Niladri.Biswas on 7/12/2012 | Category: Sql Server Interview questions | Views: 1216 | Points: 40

Given a list of values and a position, the Choose function will return the value at the indicated position.

The syntax is
Choose ([Position], [Value1],[Value2],…,[ValueN])


Select Choose (1,'Value1', 'Value2','Value3') As [Choose Demo]

Choose Demo

In this example, we have specified the position as 1 and hence out of the two values, the first appears as the result.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response