8

SQL Puzzle - Unsolved CASE Expression - SQL Authority with Pinal Dave

 3 years ago
source link: https://blog.sqlauthority.com/2021/04/20/sql-puzzle-unsolved-case-expression/?utm_campaign=sql-puzzle-unsolved-case-expression
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
SQL Authority with Pinal Dave

SQL Puzzle – Unsolved CASE Expression

My earlier puzzle SQL Puzzle – SELECT ~ 1 : Guess the Answer received over 125 responses while I am writing this one. Lots of people have asked me to share another puzzle. Well, let us see a very simple puzzle of Unsolved CASE Expression.

SQL Puzzle - Unsolved CASE Expression UnsolvedCASEExpression-800x278

Unsolved CASE Expression

Without running the following command, guess the output of the SELECT statement:

SELECT
CASE
WHEN 1 <> 1 THEN 1
WHEN 2 <> 2 THEN 2
END 'Result'

As I really want you to run the query, I am not going to share the output here in this blog post. Once you run the puzzle, I would like you to comment on the reason for the query to return the result which it is returning.

Well, that’s it for today. Leave your answer in the comments section.

Let me know if you are interested to know more about this topic and I will write more blogs as well as create an SQL in Sixty Seconds video.

Here are my few recent videos and I would like to know what is your feedback about them.

Reference: Pinal Dave (http://blog.SQLAuthority.com)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK