SQL SERVER TUTORIAL IN DEPTH

The blog is to help users about sql server

Others

LightBlog

Breaking

Saturday, 4 January 2014

IIF and CHOOSE in Sql Server

-->Features are avaliable in Sql Server 2012

DECLARE @X INT;
SET @X=50;
DECLARE @Y INT;
SET @Y=60;

Select iif(@X > @Y, 50, 60) As IIFResult










DECLARE @ShowIndex INT;

SET @ShowIndex =3;
Select Choose(@ShowIndex, 'A','N','U','R','A','G','N','K') As ChooseResult



No comments:

Post a Comment

 test