Select Group_inspection_unit_ID From Physical_examination_registration Where [CheckUpTeamUnitBill] = 2 And [CheckUpPay] = 0;;
SELECT SUM([CheckUpMoney]) AS CheckUpMoney_SUM FROM Physical_examination_registration WHERE [CheckUpTeamUnitBill]=2 AND Group_inspection_unit_ID=?;
SELECT SUM([CheckUpMoney_RealPrice]) AS CheckUpMoney_RealPrice_SUM FROM Physical_examination_registration WHERE [CheckUpTeamUnitBill]=2 AND [CheckUpPay]=1 AND Group_inspection_unit_ID=?;
第一个语句的查询结果依次带入第二个和第三个语句中,最后形成表,列名依次是Group_inspection_unit_ID,CheckUpMoney_SUM,CheckUpMoney_RealPrice_SUM。
有大佬知道怎么解决吗?实在不行给个思路也行