title: How to solve error in sql decode of annotation in django
body: <p>I am working on django framework with mangodb database. </p>
  
  <p>CRUD operations are working fine but I am facing an issue on annotation query receiving error:</p>
  
  <pre><code>djongo.sql2mongo.SQLDecodeError: FAILED SQL: SELECT "app_message"."type", SUM(CASE WHEN "app_message"."type" = %(0)s THEN %(1)s ELSE %(2)s END) AS "bot" FROM "app_message" GROUP BY "app_message"."type"  LIMIT 21
  Params: ('Outbound', 1, 0)
  Version: 1.2.38
  </code></pre>
  
  <pre><code>Message.objects.values('type').\
              annotate(bot=Count(Case(When(type="Outbound", then='id'), default=Value(0),
                                      output_field=IntegerField()),
                                 ))
  </code></pre>
  
  <p>Tried version 1.2.31 as well but no luck.</p>
  
  <p>Python version: 3.6.1, 
  Django version: 2.2.7</p>