Tips and Tricks for SQL-BI
Tips and Tricks for SQL Server Developers
SQL Server Questions and Answers
Friday, May 28, 2010
T-SQL Puzzle 2 - CASE Statement
What will be the output of below Query:
DECLARE
@f as
int
SET
@f = 1
SELECT CASE
1
WHEN
@f
THEN
'First'
WHEN
@f
THEN
'Second'
ELSE
'Nothing'
END
AS
CaseStmt
Below are the options:
1. First
2. Second
3. Nothing
4. No records
5. syntax Error
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Here are few FREE resources you may find helpful.
No comments:
Post a Comment