Postgresql – Django RawSQL annotate field
How can i annotate field with RawSQL? sql_query = """ SELECT c.id, COALESCE(SUM((cm.temp_min + cm.temp_max) / 2 - %s), 0) AS gdd FROM agriculture_commune c LEFT JOIN agriculture_communemeteo cm ON c.id = cm.commune_id WHERE cm.date BETWEEN %s AND %s GROUP…