sb_project = ///'select x.C_CITID, x.C_COUID, x.C_TOWID, sum(y.m9), sum(y.m1), sum(y.m2), sum(y.m3), sum(y.m4), sum(y.m5), sum(y.m6), sum(y.m7), sum(y.m8) from db_twenty.t_project x LEFT JOIN db_twenty.t_projectreports y ON (y.R_PROJECT_ID = x.C_ID AND y.C_DELETED = 0 and y.C_ANNUAL*100+y.C_PERIOD<=?) WHERE x.C_DELETED = 0 and x.C_AUDITSTATUS = 1 group by x.C_ID///

SQL Query for Project Data Aggregation with SUM and LEFT JOIN

原文地址: https://www.cveoy.top/t/topic/p06S 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录