Site icon Database Tutorials

CHOOSE and IIF Functions in SQL Server

 

CHOOSE and IIF functions are logical functions.

CHOOSE function returns the value at the specified index from the specified list.

IIF function performs the work of the IF ELSE statement with one command. If it’s true, do something, if it’s not true, do something else.

Let’s make examples for a better understanding of CHOOSE and IIF functions.

CHOOSE Function:

IIF Function:

Exit mobile version