sql if…else statement

DECLARE @Number int;
SET @Number = 50;
IF @Number > 100
PRINT ‘The number is large.’;
ELSE
BEGIN
IF @Number < 10
PRINT ‘The number is small.’;
ELSE
PRINT ‘The number is medium.’;
END ;
GO

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.