-2

Firstly, Could you look at the full example on dbfiddle website?

Secondly, Could you look at this answer?

Inside the count clause, There is a condition without Else.

When the condition does not match, What will be put inside the count clause because there is no Else?

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
luq891
  • 43
  • 5
  • 2
    Questions should be self-contained. Do not rely on external websites to provide pertinent information. Please include the queries inline in your question (the links can remain as support, but should not be the main source of the query). – Mark Rotteveel Jun 03 '22 at 08:42
  • 1
    That said, the default result for a `CASE` without `ELSE` is `NULL`. – Mark Rotteveel Jun 03 '22 at 08:43
  • 3
    *When the condition does not match, What will be put inside the count clause because there is no Else?* When none condition in CASE operator (not a clause and in your code not a statement) matches then the result of the operator is set to NULL. And COUNT() won't count it - it counts the amount of NOT NULL expression values. – Akina Jun 03 '22 at 08:50

0 Answers0