SQL SERVER CASE PUZZLE QUERY

What would be the output of following query? 😄
SELECT CASE WHEN 1=1 THEN 'Vikas Ahlawat1'
            WHEN 2=2 THEN 'Vikas Ahlawat2'

            ELSE  'Vikas Ahlawat3' END AS Name

Ans:

Comments

  1. Replies
    1. Thanks
      for more such questions you can follow this link http://www.interviewquestionspdf.com/2014/12/sql-server-interview-questions-and.html

      Delete
  2. CAN U PLEASE EXPLAIN...........

    ReplyDelete
  3. case is just as switch.. when first case is true then it get terminated from that point only.

    ReplyDelete

Contact Form

Send