我想在Django代码中执行SQL查询,但是我不知道如何编写代码以及在哪里编写代码...
SQL查询
SELECT submission_meterials_list.id, submission_meterials_list.material, SUM(reported_materials.kg) AS quantity
FROM reported_materials,kw_report_submissions,submission_meterials_list
WHERE reported_materials.submission_id=kw_report_submissions.id AND submission_meterials_list.id=reported_materials.material_id AND kw_report_submissions.requested_on >= '2019-04-21' AND kw_report_submissions.requested_on <='2019-04-27'
GROUP BY submission_meterials_list.material