django rest api-如何将多个表中的数据插入到单个表中

r6vfmomb  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(169)

我编写了一个查询,其中我只是从多个表中选择不同的列。我正在学习django rest api,我想编写一个api,将查询中的数据插入到自定义转储表中。如果你能简单回答我的问题,我将不胜感激。这是我的问题。

query= """ select pa.height, pa.weight, pa.muac, pa.tsf, pa.bmi, pa.nutritionist_comment,
        pa.create_date_app_side, hp.gender, hp.name, hp.regn_date_hospital, hp.dob, 
        hp.city, hp.diagnosis_list_id, hp.diagnosis_stage, hg.first_name, 
        hg.phone_number, hg.preferred_language_id
        from patientcounselling_anthropometric as pa
        join hospital_patient as hp on hp.uuid=pa.patient_uuid
        join hospital_guardian hg on hg.patient_uuid=hp.uuid """

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题