SQL CHOOSE Logical Function

The SQL CHOOSE Logical Function returns the item at the specified index from a list of values in SQL Server.  I’ve used it sporadically, but it equates to a work around for the CASE statement, making the query a bit more readable in some instances.  Let’s get to a couple examples.

SQL CHOOSE Logical Function – Simple Example #1

Result:

SQL CHOOSE Logical Function

SQL CHOOSE Logical Function – Simple Example #2

Result:

SQL CHOOSE Logical Function

SQL CHOOSE Logical Function – Complex Example

Result:

SQL CHOOSE Logical Function

 

 

Additional Content

Check out more examples by visiting my Home Page

Here you will find topics covering  Qlikview  SQL Server  Excel VBA

 

 

Leave a Comment