I have a table say Table1 which has only one column ID (integer). This table contains two rows with value 3 and 9. When I execute the following SQL on the table the output is 5.

Select Case Count(*)
When Sum(CASE ID WHEN 3 THEN 1 ELSE 0 END) THEN 1
When Sum(CASE ID WHEN 9 THEN 1 ELSE 0 END) THEN 1
Else 5
End
From Table1

Can any one please explain me what exactly this SQL does.