4
Reply

Q. What is the result of following query?

Rajeev Kumar

Rajeev Kumar

1y
1.9k
0
Reply
  1. SELECT
  2. CASE WHEN null = null
  3. THEN True
  4. ELSE False
  5. END AS Result;

    Ans :- Null

    When we compare the null = null then sql understand it like Unknown but when we return its value in identity then you will get the null as result.

    False

    The result will be 'False'This is because the comparison 'NULL=NULL' evaluates to 'UNKNOWN', and since there is no specific condation for 'UNKNOWN' in your 'CASE' statement, it falls back to the 'ELSE' clause, which return 'False'

    False