|
|
select a.gridName,a.count-IFNULL(b.countQj,0) as zz,IFNULL(b.countQj,0) as qj from ( select b.name as gridName , count(a.id) as count ,b.id from centerdata_t_forest_linleader a , centerdata_t_forest_grid_level b where a.lin_grid_id= b.id
|
|
|
group by b.name ) a left join (SELECT count(a.id) as countQj,a.lin_grid_id FROM `centerdata_t_forest_linleader` a ,centerdata_t_leave b where a.user_id =b.leave_user_id and b.leave_end_time>= current_timestamp group by a.user_id ,a.lin_grid_id) b on a.id= b.lin_grid_id
|